Skip to content

Commit

Permalink
Fixing versioning of releases to get rid of v in files (#20)
Browse files Browse the repository at this point in the history
* Fixing versioning of releases to get rid of `v` in files

Current releases had `v` in all the files which is against a current standard.
Therefore, we should remove this.

* Changing tarball non-standard binary names

Solving issue #19 to make tarballs contain standard binary names and removing the redundant /binaries directory

Test:
build the tarbals with `./build_tarballs.sh`
and checked the tarball contents:
```
vagrant@ubuntu-xenial:~/repos/nvdtools/release$ tar zvft nvdtools-4.4.4-linux-amd64.tar.gz
-rwxrwxr-x vagrant/vagrant 3513959 2019-01-24 00:36 cpe2cve
-rwxrwxr-x vagrant/vagrant 2233700 2019-01-24 00:36 csv2cpe
-rwxrwxr-x vagrant/vagrant 8595732 2019-01-24 00:36 nvdsync
-rwxrwxr-x vagrant/vagrant 2229430 2019-01-24 00:36 rpm2cpe
```
  • Loading branch information
jokLiu authored and skogtwin committed Jan 24, 2019
1 parent 7e1cd1e commit 206aa1b
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 5 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ script:
- go test -v ./...

before_deploy:
- export VERSION=${TRAVIS_TAG:1}
- chmod +x build_tarballs.sh && ./build_tarballs.sh
- make -C rpm/
- dpkg-buildpackage -rfakeroot -uc -us && mv ../*.deb release
Expand Down
1 change: 0 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ CSV2CPE=csv2cpe
NVDSYNC=nvdsync
RPM2CPE=rpm2cpe

VERSION=$(TRAVIS_TAG)
NAME=nvdtools
PKG=$(NAME)-$(VERSION)
TGZ=$(PKG).tar.gz
Expand Down
6 changes: 3 additions & 3 deletions build_tarballs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,17 @@ CSV2CPE=csv2cpe
NVDSYNC=nvdsync
RPM2CPE=rpm2cpe
NAME=nvdtools
VERSION=$TRAVIS_TAG

function build_binaries_and_tars(){
GOOS=$1; shift
ARCHS=("$@")
for GOARCH in ${ARCHS[@]}; do
for BINARY in $CPE2CVE $CSV2CPE $NVDSYNC $RPM2CPE; do
env GOOS=$GOOS GOARCH=$GOARCH go build -o binaries/$BINARY-$VERSION-$GOOS-$GOARCH ./cmd/$BINARY
env GOOS=$GOOS GOARCH=$GOARCH go build -o $BINARY ./cmd/$BINARY
done
tar -zcvf release/$NAME-$VERSION-$GOOS-$GOARCH.tar.gz \
binaries/{$CPE2CVE,$CSV2CPE,$NVDSYNC,$RPM2CPE}-$VERSION-$GOOS-$GOARCH
{$CPE2CVE,$CSV2CPE,$NVDSYNC,$RPM2CPE}
make clean
done
}

Expand Down
4 changes: 4 additions & 0 deletions debian/rules
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,7 @@

%:
dh $@

override_dh_gencontrol:
dh_gencontrol -- -v$(VERSION)

2 changes: 1 addition & 1 deletion rpm/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ all:
mv ../nvdtools-*.gz $(HOME)/rpmbuild/SOURCES
cp nvdtools.spec $(HOME)/rpmbuild/SPECS
cd $(HOME)/rpmbuild/SPECS
rpmbuild -ba --define="_tag $(TRAVIS_TAG)" nvdtools.spec
rpmbuild -ba --define="_tag $(VERSION)" nvdtools.spec

0 comments on commit 206aa1b

Please sign in to comment.