Merge branch 'feature-debian-packages' into develop
add feauture build-deb
This commit is contained in:
commit
cee0bd03ca
1
.gitignore
vendored
1
.gitignore
vendored
@ -1 +1,2 @@
|
|||||||
/build
|
/build
|
||||||
|
/release
|
||||||
|
12
DEBIAN/control
Normal file
12
DEBIAN/control
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
Package: remaster
|
||||||
|
Source: remaster
|
||||||
|
Version: 1.9.3
|
||||||
|
Architecture: all
|
||||||
|
Maintainer: 6543 <6543@obermui.de>
|
||||||
|
Installed-Size: <SIZE>
|
||||||
|
Depends: squashfs-tools, xorriso, wget, sed, sendemail, bash
|
||||||
|
Suggests: nfs-kernel-server, isc-dhcp-server
|
||||||
|
Section: utils
|
||||||
|
Priority: optional
|
||||||
|
Homepage: https://github.com/6543/remaster
|
||||||
|
Description: The aim of this Project is to create a daemon for a server, witch update live systems.
|
1
DEBIAN/postinst
Executable file
1
DEBIAN/postinst
Executable file
@ -0,0 +1 @@
|
|||||||
|
#!/bin/sh
|
1
DEBIAN/postrm
Executable file
1
DEBIAN/postrm
Executable file
@ -0,0 +1 @@
|
|||||||
|
#!/bin/sh
|
1
DEBIAN/preinst
Executable file
1
DEBIAN/preinst
Executable file
@ -0,0 +1 @@
|
|||||||
|
#!/bin/sh
|
1
DEBIAN/prerm
Executable file
1
DEBIAN/prerm
Executable file
@ -0,0 +1 @@
|
|||||||
|
#!/bin/sh
|
50
autogen.sh
50
autogen.sh
@ -1,15 +1,13 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
# at the moment only generate dir structure in /build
|
# install | clean | debug | build-deb
|
||||||
|
|
||||||
#make ...
|
|
||||||
function clean() {
|
function clean() {
|
||||||
echo "clear build"
|
echo "clear build"
|
||||||
[ -d build ] && rm -v -R build
|
[ -d build ] && rm -v -R build
|
||||||
mkdir build
|
mkdir build
|
||||||
}
|
}
|
||||||
function build() {
|
function copy() {
|
||||||
echo "build ..."
|
echo "copy files ..."
|
||||||
## skripte copieren ##
|
|
||||||
# remaster
|
# remaster
|
||||||
mkdir -p build/usr/bin/
|
mkdir -p build/usr/bin/
|
||||||
cp -v src/remaster.sh build/usr/bin/remaster
|
cp -v src/remaster.sh build/usr/bin/remaster
|
||||||
@ -26,6 +24,10 @@ function build() {
|
|||||||
mkdir -p build/etc/remaster/
|
mkdir -p build/etc/remaster/
|
||||||
cp -v src/config.sample.cfg build/etc/remaster/config.sample.cfg
|
cp -v src/config.sample.cfg build/etc/remaster/config.sample.cfg
|
||||||
|
|
||||||
|
#changelog
|
||||||
|
mkdir -p build/usr/share/doc/remaster
|
||||||
|
cp -v changes/remaster.md build/usr/share/doc/remaster/changelog
|
||||||
|
gzip build/usr/share/doc/remaster/changelog
|
||||||
}
|
}
|
||||||
|
|
||||||
#config ...
|
#config ...
|
||||||
@ -45,17 +47,42 @@ function set_libdir() {
|
|||||||
#modes
|
#modes
|
||||||
function debug() {
|
function debug() {
|
||||||
clean
|
clean
|
||||||
build
|
copy
|
||||||
set_rootdir "`pwd`/build"
|
set_rootdir "`pwd`/build"
|
||||||
set_libdir "`pwd`/build/usr/lib/remaster"
|
set_libdir "`pwd`/build/usr/lib/remaster"
|
||||||
}
|
}
|
||||||
function install() {
|
function install() {
|
||||||
clean
|
clean
|
||||||
build
|
copy
|
||||||
set_rootdir ""
|
set_rootdir ""
|
||||||
set_libdir "/usr/lib/remaster"
|
set_libdir "/usr/lib/remaster"
|
||||||
#cp -f -r build/* /
|
#cp -f -r build/* /
|
||||||
}
|
}
|
||||||
|
function build-deb() {
|
||||||
|
clean
|
||||||
|
#prebuild
|
||||||
|
copy
|
||||||
|
set_rootdir ""
|
||||||
|
set_libdir "/usr/lib/remaster"
|
||||||
|
####
|
||||||
|
## changes for deb file
|
||||||
|
####
|
||||||
|
cp -v -r -f DEBIAN build/
|
||||||
|
#create md5sums
|
||||||
|
find ./build -type f -exec md5sum {} \; | grep -v './build/DEBIAN' | sed 's/\.\/build\///g' > build/DEBIAN/md5sums
|
||||||
|
#set size
|
||||||
|
SIZE="`du --exclude=build/DEBIAN -c build/ | cut -f 1 | tail -n 1`"
|
||||||
|
sed -i "s/<SIZE>/$SIZE/g" build/DEBIAN/control
|
||||||
|
|
||||||
|
##
|
||||||
|
#build deb
|
||||||
|
##
|
||||||
|
dpkg -b build/
|
||||||
|
version="`cat build/DEBIAN/control | grep Version | cut -d " " -f 2`"
|
||||||
|
arch="`cat build/DEBIAN/control | grep Arch | cut -d " " -f 2`"
|
||||||
|
[ -f "release/remaster_"$version"_"$arch".deb" ] && rm "release/remaster_"$version"_"$arch".deb"
|
||||||
|
mv -v "build.deb" "release/remaster_"$version"_"$arch".deb"
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
case "$1" in
|
case "$1" in
|
||||||
@ -68,10 +95,13 @@ case "$1" in
|
|||||||
debug)
|
debug)
|
||||||
debug || exit 1
|
debug || exit 1
|
||||||
;;
|
;;
|
||||||
build)
|
copy)
|
||||||
build || exit 1
|
copy || exit 1
|
||||||
|
;;
|
||||||
|
build-deb)
|
||||||
|
build-deb || exit 1
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
echo "Usage: install | clean | debug | build"
|
echo "Usage: install | clean | debug | build-deb"
|
||||||
exit 1
|
exit 1
|
||||||
esac
|
esac
|
||||||
|
@ -20,3 +20,7 @@ date=`date +%Y-%m-%d`
|
|||||||
echo $date - $version >> changes/remaster.md
|
echo $date - $version >> changes/remaster.md
|
||||||
echo pleace update changes/remaster.md
|
echo pleace update changes/remaster.md
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[ -f "DEBIAN/control" ] && {
|
||||||
|
sed -i "s/Version:\ .\..\../Version:\ $version_sed/g" "DEBIAN/control"
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user