fix package script

This commit is contained in:
stubbfel
2015-11-23 23:37:14 +01:00
parent 25a99ca0d2
commit 1a7229e8b1
4 changed files with 63 additions and 13 deletions

19
dist/package/PKGBUILD vendored
View File

@@ -5,7 +5,7 @@ pkgdesc="transparent one to one nat"
arch=(any)
url="http://www.foo.org"
license=('MIT')
depends=('pth' 'libpcap' 'python2')
depends=('pth' 'libpcap' 'python2' 'jsoncpp')
makedepends=('cmake')
source=(./$pkgname-$pkgver.tar.gz)
md5sums=('0e1494ebbcf0b0ca1bfa8475c5078f21')
@@ -14,12 +14,12 @@ build() {
cd "${srcdir}/${pkgname}"
cd lib
mkdir -p bin
mkdir -p build/jsoncpp/
cd build/jsoncpp/
cmake ../../src/jsoncpp -DCMAKE_INSTALL_PREFIX=/usr
make
cp src/lib_json/libjsoncpp.a ../../bin
cd ../..
# mkdir -p build/jsoncpp/
# cd build/jsoncpp/
# cmake ../../src/jsoncpp -DCMAKE_INSTALL_PREFIX=/usr
# make
# cp src/lib_json/libjsoncpp.a ../../bin
# cd ../..
mkdir -p build/libtins/
cd build/libtins/
cmake ../../src/libtins -DLIBTINS_BUILD_SHARED=1 -DLIBTINS_ENABLE_CXX11=1 -DLIBTINS_ENABLE_WPA2=0 -DLIBTINS_ENABLE_DOT11=0 -DHAVE_PCAP_IMMEDIATE_MODE=1 -DCMAKE_INSTALL_PREFIX=/usr
@@ -34,8 +34,8 @@ build() {
}
package() {
cd ${srcdir}/${pkgname}/lib/build/jsoncpp
make DESTDIR="${pkgdir}" install
#cd ${srcdir}/${pkgname}/lib/build/jsoncpp
#make DESTDIR="${pkgdir}" install
cd "${srcdir}/${pkgname}/lib/build/libtins"
make DESTDIR="${pkgdir}" install
cd "${srcdir}/${pkgname}/build/121Natbuild"
@@ -44,3 +44,4 @@ package() {
cp "../../src/config.json" "${pkgdir}/etc/${pkgname}/config-example.json"
rm -R "${pkgdir}/usr/CMake"
}
md5sums=('6d9edd32ba681731501820c5330bd692')

46
dist/package/PKGBUILD.example vendored Normal file
View File

@@ -0,0 +1,46 @@
pkgname=121Nat
pkgver=1.0 # note: if the pkgver had been '0.99-10' then use an underscore. like '0.99_10'
pkgrel=1
pkgdesc="transparent one to one nat"
arch=(any)
url="http://www.foo.org"
license=('MIT')
depends=('pth' 'libpcap' 'python2' 'jsoncpp')
makedepends=('cmake')
source=(./$pkgname-$pkgver.tar.gz)
md5sums=('0e1494ebbcf0b0ca1bfa8475c5078f21')
build() {
cd "${srcdir}/${pkgname}"
cd lib
mkdir -p bin
# mkdir -p build/jsoncpp/
# cd build/jsoncpp/
# cmake ../../src/jsoncpp -DCMAKE_INSTALL_PREFIX=/usr
# make
# cp src/lib_json/libjsoncpp.a ../../bin
# cd ../..
mkdir -p build/libtins/
cd build/libtins/
cmake ../../src/libtins -DLIBTINS_BUILD_SHARED=1 -DLIBTINS_ENABLE_CXX11=1 -DLIBTINS_ENABLE_WPA2=0 -DLIBTINS_ENABLE_DOT11=0 -DHAVE_PCAP_IMMEDIATE_MODE=1 -DCMAKE_INSTALL_PREFIX=/usr
make
cp lib/libtins.so ../../bin
cd ../../..
mkdir -p build/121Natbuild
cd build/121Natbuild
cmake ../../ -DCMAKE_INSTALL_PREFIX=/usr
make
cp src/121Nat ../
}
package() {
#cd ${srcdir}/${pkgname}/lib/build/jsoncpp
#make DESTDIR="${pkgdir}" install
cd "${srcdir}/${pkgname}/lib/build/libtins"
make DESTDIR="${pkgdir}" install
cd "${srcdir}/${pkgname}/build/121Natbuild"
make DESTDIR="${pkgdir}" install
mkdir -p "${pkgdir}/etc/${pkgname}"
cp "../../src/config.json" "${pkgdir}/etc/${pkgname}/config-example.json"
rm -R "${pkgdir}/usr/CMake"
}

View File

@@ -6,12 +6,15 @@ cp -R ../../lib/src/ temp/121Nat/lib/
cp ../../lib/*.sh temp/121Nat/lib/
cp ../../build.sh temp/121Nat/
cp ../../CMakeLists.txt temp/121Nat/
cp PKGBUILD temp/
cp PKGBUILD.example temp/PKGBUILD
cd temp
tar -cvzf 121Nat-1.0.tar.gz 121Nat/
md5=($(md5sum 121Nat-1.0.tar.gz))
echo "md5sums=('$md5')" >> PKGBUILD
makepkg
cp temp/*.pkg.tar.xz .
rm -Rf temp/121Nat/
cp *.pkg.tar.xz ../
cp *.tar.gz ../
cp -f PKGBUILD ../PKGBUILD
cd ..
rm -Rf temp

View File

@@ -1,6 +1,6 @@
file(GLOB_RECURSE 121Nat_Src_Files "*.h" "*.cpp")
add_executable(121Nat ${121Nat_Src_Files})
target_link_libraries (121Nat pthread ${CMAKE_SOURCE_DIR}/lib/bin/libtins.so ${CMAKE_SOURCE_DIR}/lib/bin/libjsoncpp.a)
target_link_libraries (121Nat pthread ${CMAKE_SOURCE_DIR}/lib/bin/libtins.so jsoncpp)
target_compile_features(121Nat PRIVATE cxx_range_for)
install(TARGETS 121Nat
RUNTIME DESTINATION bin