Skip to content
This repository was archived by the owner on Dec 1, 2024. It is now read-only.

Commit 206aa1b

Browse files
jokLiuskogtwin
authored andcommitted
Fixing versioning of releases to get rid of v in files (#20)
* 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 ```
1 parent 7e1cd1e commit 206aa1b

File tree

5 files changed

+9
-5
lines changed

5 files changed

+9
-5
lines changed

.travis.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ script:
1414
- go test -v ./...
1515

1616
before_deploy:
17+
- export VERSION=${TRAVIS_TAG:1}
1718
- chmod +x build_tarballs.sh && ./build_tarballs.sh
1819
- make -C rpm/
1920
- dpkg-buildpackage -rfakeroot -uc -us && mv ../*.deb release

Makefile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ CSV2CPE=csv2cpe
88
NVDSYNC=nvdsync
99
RPM2CPE=rpm2cpe
1010

11-
VERSION=$(TRAVIS_TAG)
1211
NAME=nvdtools
1312
PKG=$(NAME)-$(VERSION)
1413
TGZ=$(PKG).tar.gz

build_tarballs.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,17 @@ CSV2CPE=csv2cpe
55
NVDSYNC=nvdsync
66
RPM2CPE=rpm2cpe
77
NAME=nvdtools
8-
VERSION=$TRAVIS_TAG
98

109
function build_binaries_and_tars(){
1110
GOOS=$1; shift
1211
ARCHS=("$@")
1312
for GOARCH in ${ARCHS[@]}; do
1413
for BINARY in $CPE2CVE $CSV2CPE $NVDSYNC $RPM2CPE; do
15-
env GOOS=$GOOS GOARCH=$GOARCH go build -o binaries/$BINARY-$VERSION-$GOOS-$GOARCH ./cmd/$BINARY
14+
env GOOS=$GOOS GOARCH=$GOARCH go build -o $BINARY ./cmd/$BINARY
1615
done
1716
tar -zcvf release/$NAME-$VERSION-$GOOS-$GOARCH.tar.gz \
18-
binaries/{$CPE2CVE,$CSV2CPE,$NVDSYNC,$RPM2CPE}-$VERSION-$GOOS-$GOARCH
17+
{$CPE2CVE,$CSV2CPE,$NVDSYNC,$RPM2CPE}
18+
make clean
1919
done
2020
}
2121

debian/rules

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,7 @@
22

33
%:
44
dh $@
5+
6+
override_dh_gencontrol:
7+
dh_gencontrol -- -v$(VERSION)
8+

rpm/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@ all:
88
mv ../nvdtools-*.gz $(HOME)/rpmbuild/SOURCES
99
cp nvdtools.spec $(HOME)/rpmbuild/SPECS
1010
cd $(HOME)/rpmbuild/SPECS
11-
rpmbuild -ba --define="_tag $(TRAVIS_TAG)" nvdtools.spec
11+
rpmbuild -ba --define="_tag $(VERSION)" nvdtools.spec

0 commit comments

Comments
 (0)