add build scripts for debs and rpms
This commit is contained in:
9
software/build-scripts/INSTALL.arch
Normal file
9
software/build-scripts/INSTALL.arch
Normal file
@@ -0,0 +1,9 @@
|
||||
post_install() {
|
||||
systemctl enable infnoise
|
||||
systemctl restart systemd-udevd
|
||||
}
|
||||
|
||||
pre_remove() {
|
||||
systemctl disable infnoise
|
||||
systemctl restart systemd-udevd
|
||||
}
|
||||
22
software/build-scripts/PKGBUILD.arch
Normal file
22
software/build-scripts/PKGBUILD.arch
Normal file
@@ -0,0 +1,22 @@
|
||||
# Maintainer: Manuel Domke <info@manuel-domke.de>
|
||||
pkgname=infnoise
|
||||
pkgrel=1
|
||||
pkgdesc='Infinite Noise TRNG'
|
||||
license=('open')
|
||||
url='https://github.com/manuel-domke/infnoise'
|
||||
depends=('libftdi-compat')
|
||||
makedepends=()
|
||||
source=('git+https://github.com/manuel-domke/infnoise.git')
|
||||
md5sums=('SKIP')
|
||||
install='INSTALL'
|
||||
build() {
|
||||
cd "${srcdir}/infnoise/software/"
|
||||
make
|
||||
}
|
||||
|
||||
package() {
|
||||
install -Dvm755 "${srcdir}/infnoise/software/infnoise" "${pkgdir}/usr/bin/infnoise"
|
||||
install -Dvm644 "${srcdir}/infnoise/software/init_scripts/75-infnoise.rules" "${pkgdir}/etc/udev/rules.d/75-infnoise.rules"
|
||||
install -Dvm644 "${srcdir}/infnoise/software/init_scripts/infnoise.conf.systemd" "${pkgdir}/etc/infnoise.conf"
|
||||
install -Dvm644 "${srcdir}/infnoise/software/init_scripts/infnoise.service.bin" "${pkgdir}/etc/systemd/system/infnoise.service"
|
||||
}
|
||||
9
software/build-scripts/README.md
Normal file
9
software/build-scripts/README.md
Normal file
@@ -0,0 +1,9 @@
|
||||
these scripts need to be copied to the software directory to be used.
|
||||
|
||||
currently creating packages of the following:
|
||||
- DEB (Debian, Ubuntu, Raspbian)
|
||||
- RPM (CentOS, Fedora)
|
||||
- ArchLinux
|
||||
|
||||
These are signed and made available at the repository:
|
||||
|
||||
24
software/build-scripts/build-archlinux.sh
Executable file
24
software/build-scripts/build-archlinux.sh
Executable file
@@ -0,0 +1,24 @@
|
||||
#!/bin/bash
|
||||
|
||||
VERSION=`git --no-pager describe --tags --always`
|
||||
|
||||
# x86_64
|
||||
mkdir -p x86_64
|
||||
cd x86_64
|
||||
|
||||
cp ../build-scripts/PKGBUILD.arch PKGBUILD
|
||||
cp ../build-scripts/INSTALL.arch INSTALL
|
||||
echo "pkgver=$VERSION" >> PKGBUILD
|
||||
echo "arch=('x86_64')" >> PKGBUILD
|
||||
ls -lah
|
||||
makepkg -f --sign --key 975DC25C4E730A3C
|
||||
cd ..
|
||||
|
||||
# x86_64
|
||||
mkdir -p x86
|
||||
cd x86
|
||||
cp ../build-scripts/PKGBUILD.arch PKGBUILD
|
||||
cp ../build-scripts/INSTALL.arch INSTALL
|
||||
echo "pkgver=$VERSION" >> PKGBUILD
|
||||
echo "arch=('i686')" >> PKGBUILD
|
||||
makechrootpkg -r /x86 -U jenkins -- --sign --key 975DC25C4E730A3C
|
||||
15
software/build-scripts/build-rpm.sh
Executable file
15
software/build-scripts/build-rpm.sh
Executable file
@@ -0,0 +1,15 @@
|
||||
VERSION=$1
|
||||
ARCH=$2
|
||||
|
||||
PATH=$PATH:/sbin/
|
||||
|
||||
mkdir -p SOURCES
|
||||
tar -czf SOURCES/infnoise.tar.gz . --exclude="*.sh" --exclude="SOURCES"
|
||||
|
||||
mkdir -p BUILD SPECS RPMS SRPMS
|
||||
|
||||
cp infnoise.spec SPECS
|
||||
sed -i -- 's/__VERSION__/'$VERSION'/g' SPECS/infnoise.spec
|
||||
|
||||
rpmbuild --define "_topdir `pwd`" -ba SPECS/infnoise.spec
|
||||
|
||||
36
software/build-scripts/build.sh
Executable file
36
software/build-scripts/build.sh
Executable file
@@ -0,0 +1,36 @@
|
||||
#!/bin/bash
|
||||
|
||||
ARCH=$1
|
||||
VERSION=`git --no-pager describe --tags --always`
|
||||
|
||||
PATH=$PATH:/sbin/
|
||||
|
||||
make clean
|
||||
make
|
||||
|
||||
rm -rf build
|
||||
mkdir -p build/DEBIAN
|
||||
cp build-scripts/control.debian.$ARCH build/DEBIAN/control
|
||||
cp build-scripts/infnoise.postinst build/DEBIAN/postinst
|
||||
chmod 775 build/DEBIAN/postinst
|
||||
echo "Version: $VERSION" >> build/DEBIAN/control
|
||||
|
||||
mkdir -p build/usr/sbin/
|
||||
mkdir -p build/etc/udev/rules.d/
|
||||
mkdir -p build/etc/systemd/system/
|
||||
|
||||
cp infnoise build/usr/sbin/
|
||||
cp init_scripts/infnoise.conf.systemd build/etc/infnoise.conf
|
||||
cp init_scripts/75-infnoise.rules build/etc/udev/rules.d/75-infnoise.rules
|
||||
cp init_scripts/infnoise.service.sbin build/etc/systemd/system/infnoise.service
|
||||
|
||||
if [ ! -e build/usr/sbin/infnoise ] ; then
|
||||
echo "$2 binary missing"
|
||||
exit 1;
|
||||
fi
|
||||
|
||||
# debuild -b -uc -us
|
||||
dpkg -b build/ infnoise_${VERSION}_${ARCH}.deb
|
||||
debuild -uc -us
|
||||
|
||||
rm -r build
|
||||
1
software/build-scripts/build/DEBIAN/control
Normal file
1
software/build-scripts/build/DEBIAN/control
Normal file
@@ -0,0 +1 @@
|
||||
Version: v0.2.1
|
||||
9
software/build-scripts/control.debian.amd64
Normal file
9
software/build-scripts/control.debian.amd64
Normal file
@@ -0,0 +1,9 @@
|
||||
Package: infnoise
|
||||
Architecture: amd64
|
||||
Essential: no
|
||||
Section: security
|
||||
Priority: optional
|
||||
Depends: libftdi1
|
||||
Maintainer: Manuel Domke
|
||||
Installed-Size: 12K
|
||||
Description: Infinite Noise TRNG driver.
|
||||
9
software/build-scripts/control.debian.armhf
Normal file
9
software/build-scripts/control.debian.armhf
Normal file
@@ -0,0 +1,9 @@
|
||||
Package: infnoise
|
||||
Architecture: armhf
|
||||
Essential: no
|
||||
Section: security
|
||||
Priority: optional
|
||||
Depends: libftdi1
|
||||
Maintainer: Manuel Domke
|
||||
Installed-Size: 12K
|
||||
Description: Infinite Noise TRNG driver.
|
||||
9
software/build-scripts/control.debian.x86
Normal file
9
software/build-scripts/control.debian.x86
Normal file
@@ -0,0 +1,9 @@
|
||||
Package: infnoise
|
||||
Architecture: i386
|
||||
Essential: no
|
||||
Section: security
|
||||
Priority: optional
|
||||
Depends: libftdi1
|
||||
Maintainer: Manuel Domke
|
||||
Installed-Size: 12K
|
||||
Description: Infinite Noise TRNG driver.
|
||||
7
software/build-scripts/infnoise.postinst
Normal file
7
software/build-scripts/infnoise.postinst
Normal file
@@ -0,0 +1,7 @@
|
||||
#!/bin/sh
|
||||
|
||||
systemctl daemon-reload
|
||||
systemctl enable infnoise
|
||||
|
||||
#service infnoise start
|
||||
service udev reload
|
||||
37
software/build-scripts/infnoise.spec
Normal file
37
software/build-scripts/infnoise.spec
Normal file
@@ -0,0 +1,37 @@
|
||||
Name: infnoise
|
||||
Version: __VERSION__
|
||||
Release: 0
|
||||
Summary: Infinite Noise TRNG
|
||||
Group: Applications/Security
|
||||
License: GPL
|
||||
URL: https://github.com/manuel-domke/infnoise
|
||||
Vendor: 13-37.org
|
||||
Source: infnoise.tar.gz
|
||||
Prefix: %{_prefix}
|
||||
Packager: Manuel Domke
|
||||
BuildRoot: %{_tmppath}/%{name}-root
|
||||
|
||||
%description
|
||||
|
||||
%prep
|
||||
tar -xzf ../SOURCES/infnoise.tar.gz
|
||||
|
||||
%build
|
||||
make
|
||||
|
||||
%install
|
||||
#make DESTDIR=$RPM_BUILD_ROOT install
|
||||
install -Dvm755 "infnoise" "$RPM_BUILD_ROOT/usr/bin/infnoise"
|
||||
install -Dvm644 "init_scripts/infnoise.conf.systemd" "$RPM_BUILD_ROOT/etc/infnoise.conf"
|
||||
install -Dvm644 "init_scripts/75-infnoise.rules" "$RPM_BUILD_ROOT/usr/lib/udev/rules.d/75-infnoise.rules"
|
||||
install -Dvm644 "init_scripts/infnoise.service.bin" "$RPM_BUILD_ROOT/usr/lib/systemd/system/infnoise.service"
|
||||
|
||||
%clean
|
||||
[ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT
|
||||
|
||||
%files
|
||||
%defattr(-,root,root)
|
||||
%{_bindir}/infnoise
|
||||
/etc/infnoise.conf
|
||||
%{_prefix}/lib/udev/rules.d/75-infnoise.rules
|
||||
%{_prefix}/lib/systemd/system/infnoise.service
|
||||
Reference in New Issue
Block a user