Compare commits

..

No commits in common. "ef983cadf9b5532003cdcb38672925d6fb89642e" and "9c0cb8c32f0b99175e1b30258abe59d48b065a20" have entirely different histories.

15 changed files with 150 additions and 117 deletions

View File

@ -9,7 +9,7 @@ To create deb file you just need to run the bellow command :
```bash
. joplin-server2deb
debmaker_run
debmaker_runAllStep
```
### packages available in shared repository

View File

@ -1,7 +1,7 @@
#!/bin/bash
if [ ! "$1" == "" ];
then
source /tmp/src/$1
source /tmp/dist/$1
shift
FUNC=$1
shift

View File

@ -1,82 +1,12 @@
#!/bin/bash
source ressources/${APP}/${APP}
DEBOOTSTRAP_DIR=cache/debootstrap/
MOUNT_PATH=/mnt/debmaker
source ressources/${APP}/${APP}
CACHE_APP=cache/${APP}/
MOUNT_APP=/mnt/debmaker/${APP}/
zdebmaker_getDep(){
[ -d ${DEBOOTSTRAP_DIR} ] || debmaker_debootstrapUpdate
}
[ -d ${CACHE_APP} ] || mkdir -p ${CACHE_APP}
zdebmaker_createOS(){
dd if=/dev/zero of=cache/${DEBIAN_VERSION_CODENAME}.tmp bs=100M count=5
sudo mkfs.ext4 cache/${DEBIAN_VERSION_CODENAME}.tmp
sudo mount cache/${DEBIAN_VERSION_CODENAME}.tmp ${MOUNT_PATH}/${DEBIAN_VERSION_CODENAME}
sudo DEBOOTSTRAP_DIR=cache/debootstrap/ ${DEBOOTSTRAP_DIR}/debootstrap ${DEBIAN_VERSION_CODENAME} ${MOUNT_PATH}/${DEBIAN_VERSION_CODENAME}/
sudo umount ${MOUNT_PATH}/${DEBIAN_VERSION_CODENAME}
mv cache/${DEBIAN_VERSION_CODENAME}.tmp cache/${DEBIAN_VERSION_CODENAME}
}
zdebmaker_createAppOS(){
[ -f cache/${DEBIAN_VERSION_CODENAME} ] || zdebmaker_createOS
[ "${IMAGE_SIZE}" == "" ] && IMAGE_SIZE=2
dd if=/dev/zero of=cache/${APP}.tmp bs=1G count=${IMAGE_SIZE}
sudo mkfs.ext4 cache/${APP}.tmp
sudo mount cache/${APP}.tmp ${MOUNT_PATH}/${APP}/
sudo mount cache/${DEBIAN_VERSION_CODENAME} ${MOUNT_PATH}/${DEBIAN_VERSION_CODENAME}
sudo rsync -h -X -A --numeric-ids -aH --no-whole-file --inplace --one-file-system ${MOUNT_PATH}/${DEBIAN_VERSION_CODENAME}/* ${MOUNT_PATH}/${APP}/
sudo umount ${MOUNT_PATH}/${DEBIAN_VERSION_CODENAME}
sudo umount ${MOUNT_PATH}/${APP}/
mv cache/${APP}.tmp cache/${APP}
}
zdebmaker_inject(){
sudo mount cache/${APP} ${MOUNT_PATH}/${APP}/
[ -d ${MOUNT_PATH}/${APP}/tmp/dist ] || sudo mkdir ${MOUNT_PATH}/${APP}/tmp/dist/
[ -d ${MOUNT_PATH}/${APP}/tmp/src ] && sudo rm -rf ${MOUNT_PATH}/${APP}/tmp/src/
sudo mkdir -p ${MOUNT_PATH}/${APP}/tmp/src
sudo cp -fr ressources/${APP}/* ${MOUNT_PATH}/${APP}/tmp/src
sudo cp -fr lib/exec_in_chroot.sh ${MOUNT_PATH}/${APP}/tmp/src
sudo umount ${MOUNT_PATH}/${APP}/
}
debmaker_mount_proc_sys(){
OPEN_FILE=$1
OPEN_DIR=$2
[ -d ${OPEN_FILE} ] || sudo mkdir -p ${OPEN_DIR}
sudo mount ${OPEN_FILE} ${OPEN_DIR}
[ -d ${OPEN_DIR}/proc ] || sudo mkdir -p ${OPEN_DIR}/proc
sudo mount -t proc proc ${OPEN_DIR}/proc
[ -d ${OPEN_DIR}/sys ] || sudo mkdir -p ${OPEN_DIR}/sys
sudo mount -t sysfs sys ${OPEN_DIR}/sys
}
debmaker_umount_proc_sys(){
OPEN_DIR=$1
sudo umount ${OPEN_DIR}/sys
sudo umount ${OPEN_DIR}/proc
sudo umount ${OPEN_DIR}
}
debmaker_chroot() {
OPEN_FILE=$1
debmaker_mount_proc_sys ${OPEN_FILE} ${MOUNT_PATH}/${APP}/
sudo chroot ${MOUNT_PATH}/${APP}/
debmaker_umount_proc_sys ${MOUNT_PATH}/${APP}/
}
debmaker_run(){
[ -f cache/${APP} ] || zdebmaker_createAppOS
zdebmaker_inject
debmaker_mount_proc_sys cache/${APP} ${MOUNT_PATH}/${APP}/
for CURRENT_STEP in ${STEP}
do
sudo chroot ${MOUNT_PATH}/${APP}/ /tmp/src/exec_in_chroot.sh ${APP} ${CURRENT_STEP} ${GIT_VERSION} ${DEB_VERSION}
done
find ${MOUNT_PATH}/${APP}/tmp/dist/ -name *.deb -exec cp {} dist/ \;
debmaker_umount_proc_sys ${MOUNT_PATH}/${APP}/
}
########################## SUB FUNCTION ##########################
debmaker_debootstrapUpdate(){
[ -d ${DEBOOTSTRAP_DIR} ] || mkdir ${DEBOOTSTRAP_DIR}
@ -85,5 +15,110 @@ debmaker_debootstrapUpdate(){
wget -qO - ${URL} | tar -C ${DEBOOTSTRAP_DIR} --strip-components=1 -zx ${FILES}
}
zdebmaker_getDep(){
[ -d ${DEBOOTSTRAP_DIR} ] || debmaker_debootstrapUpdate
}
valideStep(){
CURRENT_STEP=$1
RESULT=0
for tmp in ${STEP}
do
if [ $tmp == ${CURRENT_STEP} ] ; then
RESULT=1
break
fi
done
if [ $RESULT -eq 0 ]
then
echo invalid step
fi
}
getSizeImage(){
[ "${IMAGE_SIZE}" == "" ] && IMAGE_SIZE=2
}
createImage(){
dd if=/dev/zero of=${CACHE_APP}/os bs=1G count=${IMAGE_SIZE}
sudo mkfs.ext4 ${CACHE_APP}/os
}
previousStep(){
CURRENT_STEP=$1
TMP_STEP=os;
for tmp in ${STEP}
do
PREV=${TMP_STEP}
TMP_STEP=$tmp
if [ $tmp == $CURRENT_STEP ] ; then
break
fi
done
echo $PREV
}
########################## FUNCTION ##########################
debmaker_mountStep(){
CURRENT_STEP=$1
[ -d ${MOUNT_APP}/${CURRENT_STEP} ] || sudo mkdir -p ${MOUNT_APP}/${CURRENT_STEP}
sudo mount ${CACHE_APP}/${CURRENT_STEP} ${MOUNT_APP}/${CURRENT_STEP}
[ -d ${MOUNT_APP}/${CURRENT_STEP}/proc ] || sudo mkdir -p ${MOUNT_APP}/${CURRENT_STEP}/proc
sudo mount -t proc proc ${MOUNT_APP}/${CURRENT_STEP}/proc
[ -d ${MOUNT_APP}/${CURRENT_STEP}/sys ] || sudo mkdir -p ${MOUNT_APP}/${CURRENT_STEP}/sys
sudo mount -t sysfs sys ${MOUNT_APP}/${CURRENT_STEP}/sys
sleep 2
}
debmaker_umountStep(){
CURRENT_STEP=$1
sudo umount ${MOUNT_APP}/${CURRENT_STEP}/sys
sudo umount ${MOUNT_APP}/${CURRENT_STEP}/proc
sudo umount ${MOUNT_APP}/${CURRENT_STEP}
}
debmaker_chrootStep(){
CURRENT_STEP=$1
debmake_mountStep ${CURRENT_STEP}
[ -d ${MOUNT_APP}/${CURRENT_STEP}/tmp/dist/${APP} ] && sudo rm -rf ${MOUNT_APP}/${CURRENT_STEP}/tmp/dist/
sudo mkdir -p ${MOUNT_APP}/${CURRENT_STEP}/tmp/dist
sudo cp -fr ressources/${APP}/* ${MOUNT_APP}/${CURRENT_STEP}/tmp/dist
sudo cp -fr lib/exec_in_chroot.sh ${MOUNT_APP}/${CURRENT_STEP}/tmp/dist
shift
sudo chroot ${MOUNT_APP}${CURRENT_STEP}/ $*
find ${MOUNT_APP}${CURRENT_STEP}/tmp/dist/ -name *.deb -exec cp {} dist/ \;
debmake_umountStep ${CURRENT_STEP}
}
########################## FUNCTION ##########################
debmaker_runStepOS() {
CURRENT_STEP=os
getSizeImage
createImage
debmake_mountStep ${CURRENT_STEP}
sudo ${DEBOOTSTRAP_DIR}/debootstrap ${DEBIAN_VERSION_CODENAME} ${MOUNT_APP}/os/
debmake_umountStep ${CURRENT_STEP}
}
debmaker_runStepCustom() {
CURRENT_STEP=$1
valideStep ${CURRENT_STEP}
PREVIOUS=$(previousStep ${CURRENT_STEP})
echo -n copy $PREVIOUS in $CURRENT_STEP ...
cp ${CACHE_APP}/${PREVIOUS} ${CACHE_APP}/${CURRENT_STEP}
echo ": OK"
debmake_chrootStep $1 /tmp/dist/exec_in_chroot.sh ${APP} ${CURRENT_STEP} ${GIT_VERSION} ${DEB_VERSION}
}
debmaker_runAllStep(){
debmake_runStepOS
for tmp in ${STEP}
do
debmake_runStepCustom $tmp
done
}
zdebmaker_getDep

View File

@ -25,10 +25,10 @@ build() {
makedeb(){
GIT_VERSION=$1
DEB_VERSION=$2
PATH_DEB=/tmp/src/rootfs
PATH_DEB=/tmp/dist/rootfs
cp /tmp/authelia/dist/authelia ${PATH_DEB}/usr/bin/authelia
cp /tmp/authelia/config.template.yml ${PATH_DEB}/etc/authelia/configuration.yml
sed -i "s/%VERSION%/$DEB_VERSION/" ${PATH_DEB}/DEBIAN/control
fakeroot dpkg-deb -Z gzip --build ${PATH_DEB} /tmp/dist
sed -i "s/%VERSION%/$DEB_VERSION/" /tmp/dist/rootfs/DEBIAN/control
fakeroot dpkg-deb -Z gzip --build /tmp/dist/rootfs/ /tmp/dist/
}

View File

@ -25,10 +25,10 @@ build() {
makedeb(){
GIT_VERSION=$1
DEB_VERSION=$2
PATH_DEB=/tmp/src/rootfs
PATH_DEB=/tmp/dist/rootfs
tar -zxf /tmp/element-web/dist/element-${GIT_VERSION}-dirty.tar.gz --strip-components=1 -C ${PATH_DEB}/usr/lib/element-web/
cp /tmp/element-web/config.sample.json ${PATH_DEB}/etc/element-web/config.json
sed -i "s/%VERSION%/$DEB_VERSION/" ${PATH_DEB}/DEBIAN/control
fakeroot dpkg-deb -Z gzip --build ${PATH_DEB} /tmp/dist
sed -i "s/%VERSION%/$DEB_VERSION/" /tmp/dist/rootfs/DEBIAN/control
fakeroot dpkg-deb -Z gzip --build /tmp/dist/rootfs/ /tmp/dist/
}

View File

@ -31,10 +31,10 @@ build() {
makedeb(){
GIT_VERSION=$1
DEB_VERSION=$2
PATH_DEB=/tmp/src/rootfs
PATH_DEB=/tmp/dist/rootfs
cp /tmp/server/gotify-server ${PATH_DEB}/usr/bin/
cp /tmp/server/config.example.yml ${PATH_DEB}/etc/gotify/config.yml
sed -i "s/%VERSION%/$DEB_VERSION/" ${PATH_DEB}/DEBIAN/control
fakeroot dpkg-deb -Z gzip --build ${PATH_DEB} /tmp/dist
fakeroot dpkg-deb -Z gzip --build ${PATH_DEB}/ /tmp/dist/
}

View File

@ -8,12 +8,10 @@ envinit() {
echo "deb [signed-by=/usr/share/keyrings/yarnkey.gpg] https://dl.yarnpkg.com/debian stable main" > /etc/apt/sources.list.d/yarn.list
apt-get update
apt-get install -y yarn
apt-get -y dist-upgrade
}
prebuild(){
GIT_VERSION=$1
[ -d /tmp/grocy/ ] && rm -fr /tmp/grocy/
git clone --depth 1 -b ${GIT_VERSION} https://github.com/grocy/grocy.git /tmp/grocy/
}
@ -27,15 +25,15 @@ build() {
makedeb(){
GIT_VERSION=$1
DEB_VERSION=$2
PATH_DEB=/tmp/src/rootfs
PATH_DEB=/tmp/dist/rootfs
find /tmp/grocy -name .gitignore -exec rm {} \;
mv /tmp/grocy/data ${PATH_DEB}/var/lib/grocy/
cp -fr /tmp/grocy/* ${PATH_DEB}/usr/share/grocy/
cp ${PATH_DEB}/usr/share/grocy/config-dist.php ${PATH_DEB}/etc/grocy/config.php
mv ${PATH_DEB}/usr/share/grocy/data ${PATH_DEB}/var/lib/grocy/
ln -s /var/lib/grocy/data/ ${PATH_DEB}/usr/share/grocy/data
ln -s /etc/grocy/config.php ${PATH_DEB}/var/lib/grocy/data/config.php
sed -i "s/%VERSION%/$DEB_VERSION/" ${PATH_DEB}/DEBIAN/control
fakeroot dpkg-deb -Z gzip --build ${PATH_DEB} /tmp/dist
ln -s /etc/grocy/config.php ${PATH_DEB}/usr/share/grocy/data/config.php
sed -i "s/%VERSION%/$DEB_VERSION/" /tmp/dist/rootfs/DEBIAN/control
fakeroot dpkg-deb -Z gzip --build /tmp/dist/rootfs/ /tmp/dist/
}

View File

@ -29,10 +29,10 @@ build() {
makedeb(){
GIT_VERSION=$1
DEB_VERSION=$2
PATH_DEB=/tmp/src/rootfs
PATH_DEB=/tmp/dist/rootfs
cp -fr /tmp/joplin/packages/* ${PATH_DEB}/usr/lib/joplin-server/
sed -i "s/%VERSION%/$DEB_VERSION/" ${PATH_DEB}/DEBIAN/control
fakeroot dpkg-deb -Z gzip --build ${PATH_DEB} /tmp/dist
sed -i "s/%VERSION%/$DEB_VERSION/" /tmp/dist/rootfs/DEBIAN/control
fakeroot dpkg-deb -Z gzip --build /tmp/dist/rootfs/ /tmp/dist/
}

View File

@ -3,18 +3,18 @@
STEP="envinit makedeb"
envinit() {
apt-get install -y --no-install-recommends wget ca-certificates fakeroot dpkg
apt-get install -y wget ca-certificates fakeroot dpkg
}
makedeb(){
GIT_VERSION=$1
DEB_VERSION=$2
PATH_DEB=/tmp/src/rootfs
PATH_DEB=/tmp/dist/rootfs
wget https://github.com/laurent22/joplin/releases/download/v${GIT_VERSION}/Joplin-${GIT_VERSION}.AppImage -qO ${PATH_DEB}/usr/share/joplin/Joplin.AppImage
chmod +x ${PATH_DEB}/usr/share/joplin/Joplin.AppImage
sed -i "s/%VERSION%/$DEB_VERSION/" ${PATH_DEB}/DEBIAN/control
fakeroot dpkg-deb -Z gzip --build ${PATH_DEB} /tmp/dist
sed -i "s/%VERSION%/$DEB_VERSION/" /tmp/dist/rootfs/DEBIAN/control
fakeroot dpkg-deb -Z gzip --build /tmp/dist/rootfs/ /tmp/dist/
}

View File

@ -20,10 +20,10 @@ build() {
makedeb(){
GIT_VERSION=$1
DEB_VERSION=$2
PATH_DEB=/tmp/src/rootfs
PATH_DEB=/tmp/dist/rootfs
cp /tmp/whatsapp/mautrix-whatsapp ${PATH_DEB}/usr/lib/mautrix-whatsapp/mautrix-whatsapp
cp /tmp/whatsapp/example-config.yaml ${PATH_DEB}/etc/mautrix-whatsapp/config.yaml
sed -i "s/%VERSION%/$DEB_VERSION/" ${PATH_DEB}/DEBIAN/control
fakeroot dpkg-deb -Z gzip --build ${PATH_DEB} /tmp/dist
sed -i "s/%VERSION%/$DEB_VERSION/" /tmp/dist/rootfs/DEBIAN/control
fakeroot dpkg-deb -Z gzip --build /tmp/dist/rootfs/ /tmp/dist/
}

View File

@ -14,7 +14,7 @@ prebuild(){
makedeb(){
GIT_VERSION=$1
DEB_VERSION=$2
PATH_DEB=/tmp/src/rootfs
PATH_DEB=/tmp/dist/rootfs
cp -fr /tmp/rss-bridge ${PATH_DEB}/usr/share/
@ -27,7 +27,7 @@ makedeb(){
mkdir -p ${PATH_DEB}/var/cache/rss-bridge/cache/
rm ${PATH_DEB}/usr/share/rss-bridge/cache
ln -s /var/cache/rss-bridge/cache/ ${PATH_DEB}/usr/share/rss-bridge/cache
sed -i "s/%VERSION%/$DEB_VERSION/" ${PATH_DEB}/DEBIAN/control
fakeroot dpkg-deb -Z gzip --build ${PATH_DEB} /tmp/dist
sed -i "s/%VERSION%/$DEB_VERSION/" /tmp/dist/rootfs/DEBIAN/control
fakeroot dpkg-deb -Z gzip --build /tmp/dist/rootfs/ /tmp/dist/
}

View File

@ -38,9 +38,9 @@ build() {
makedeb(){
GIT_VERSION=$1
DEB_VERSION=$2
PATH_DEB=/tmp/src/rootfs
PATH_DEB=/tmp/dist/rootfs
cp -fr /tmp/web-vault/build/* ${PATH_DEB}/usr/share/vaultwarden-web
sed -i "s/%VERSION%/$DEB_VERSION/" ${PATH_DEB}/DEBIAN/control
fakeroot dpkg-deb -Z gzip --build ${PATH_DEB} /tmp/dist
sed -i "s/%VERSION%/$DEB_VERSION/" /tmp/dist/rootfs/DEBIAN/control
fakeroot dpkg-deb -Z gzip --build /tmp/dist/rootfs/ /tmp/dist/
}

View File

@ -24,9 +24,9 @@ build() {
makedeb(){
GIT_VERSION=$1
DEB_VERSION=$2
PATH_DEB=/tmp/src/rootfs
PATH_DEB=/tmp/dist/rootfs
cp -fr /tmp/vaultwarden/target/release/vaultwarden ${PATH_DEB}/usr/lib/vaultwarden/
sed -i "s/%VERSION%/$DEB_VERSION/" ${PATH_DEB}/DEBIAN/control
fakeroot dpkg-deb -Z gzip --build ${PATH_DEB} /tmp/dist
sed -i "s/%VERSION%/$DEB_VERSION/" /tmp/dist/rootfs/DEBIAN/control
fakeroot dpkg-deb -Z gzip --build /tmp/dist/rootfs/ /tmp/dist/
}

View File

@ -19,7 +19,7 @@ build() {
makedeb(){
GIT_VERSION=$1
DEB_VERSION=$2
PATH_DEB=/tmp/src/rootfs
PATH_DEB=/tmp/dist/rootfs
cp -fr /tmp/wallabag/app ${PATH_DEB}/usr/share/wallabag/app
cp -fr /tmp/wallabag/src ${PATH_DEB}/usr/share/wallabag/src
@ -35,6 +35,6 @@ makedeb(){
ln -s /var/lib/wallabag/data ${PATH_DEB}/usr/share/wallabag/data
ln -s /var/lib/wallabag/var ${PATH_DEB}/usr/share/wallabag/var
ln -s /etc/wallabag/parameters.yml ${PATH_DEB}/usr/share/wallabag/app/config/parameters.yml
sed -i "s/%VERSION%/$DEB_VERSION/" ${PATH_DEB}/DEBIAN/control
fakeroot dpkg-deb -Z gzip --build ${PATH_DEB} /tmp/dist
sed -i "s/%VERSION%/$DEB_VERSION/" /tmp/dist/rootfs/DEBIAN/control
fakeroot dpkg-deb -Z gzip --build /tmp/dist/rootfs/ /tmp/dist/
}

View File

@ -20,11 +20,11 @@ build() {
makedeb(){
GIT_VERSION=$1
DEB_VERSION=$2
PATH_DEB=/tmp/src/rootfs
PATH_DEB=/tmp/dist/rootfs
cp -fr /tmp/zigbee2mqtt/data/configuration.yaml ${PATH_DEB}/etc/zigbee2mqtt/configuration.yaml
cp -fr /tmp/zigbee2mqtt/* ${PATH_DEB}/usr/lib/zigbee2mqtt/
sed -i "s/%VERSION%/$DEB_VERSION/" ${PATH_DEB}/DEBIAN/control
fakeroot dpkg-deb -Z gzip --build ${PATH_DEB} /tmp/dist
sed -i "s/%VERSION%/$DEB_VERSION/" /tmp/dist/rootfs/DEBIAN/control
fakeroot dpkg-deb -Z gzip --build /tmp/dist/rootfs/ /tmp/dist/
}