initial commit

This commit is contained in:
Albert S. 2020-08-19 12:25:14 +02:00
當前提交 131be5e113
共有 12 個檔案被更改,包括 114 行新增0 行删除

4
CONFIG.example Normal file
查看文件

@ -0,0 +1,4 @@
TARGET_SERVER="hostname"
TARGET_PATH="/var/www/somewhere"
TARGET_OWNER="nginx"
SIGNING_KEY_EMAIL="mail@example.tld"

7
README.md Normal file
查看文件

@ -0,0 +1,7 @@
apt repository for quitesimple.org projects
===========================================
This follows a rather pragmatic approach.
Some inspiration was taken from https://manuel-io.github.io/blog/2017/07/09/creating-an-apt-repository/, thanks!
Hosted at https://repo.quitesimple.org/debian/

6
build/CHANGELOG_TEMPLATE Normal file
查看文件

@ -0,0 +1,6 @@
NAME_PLACEHOLDER (VERSION_PLACEHOLDER) unstable; urgency=medium
* Generated package for VERSION_PLACEHOLDER.
-- quitesimple.org repo management department ;-) <repo@quitesimple.org> DATE_PLACEHOLDER

14
build/adhocify/build Executable file
查看文件

@ -0,0 +1,14 @@
#!/bin/bash
source ../functions.bash
if [ $# -ne 1 ] ; then
echo "Usage: $0 poolpath" 1>&2
exit 1
fi
set -e
TAG="_auto_"
BUILDDIR=$(mktemp -d)
OUTPUT_DIR="$1"
build_git_repo "$BUILDDIR" "https://gitea.quitesimple.org/crtxcr/adhocify" adhocify "$TAG" "$OUTPUT_DIR"

查看文件

@ -0,0 +1 @@
adhocify /usr/bin/

查看文件

@ -0,0 +1,5 @@
adhocify (1.0) unstable; urgency=medium
* Initial Release.
-- quitesimple.org repo management department ;-) <repo@quitesimple.org> Tue, 18 Aug 2020 18:17:03 +0200

查看文件

@ -0,0 +1,16 @@
Source: adhocify
Section: unknown
Priority: optional
Maintainer: quitesimple.org repo management department ;-) <repo@quitesimple.org>
Build-Depends: debhelper-compat (= 12)
Standards-Version: 4.4.1
Homepage: <https://gitea.quitesimple.org/crtxcr/adhocify>
Package: adhocify
Architecture: any
Depends: ${shlibs:Depends}, ${misc:Depends}
Description: Executes commands upon file system events
This tool allows watching filesystem paths for certain events,
such as writes, deletions etc. The user specifies commands which
should be executed when those events occur. It utilizes the
inotify API to do so.

8
build/adhocify/debian/rules Executable file
查看文件

@ -0,0 +1,8 @@
#!/usr/bin/make -f
%:
dh $@
override_dh_auto_build:
make release
override_dh_auto_install:

查看文件

@ -0,0 +1 @@
3.0 (native)

34
build/functions.bash Normal file
查看文件

@ -0,0 +1,34 @@
#!/bin/bash
function newest_git_tag()
{
git tag --sort="-version:refname" | head -n 1
}
function build_git_repo()
{
BUILDDIR="$1"
REPOURL="$2"
NAME="$3"
VERSION="$4"
TARGET_DIR="$5"
cp -R debian "$BUILDDIR"
cp ../CHANGELOG_TEMPLATE "$BUILDDIR"/debian/changelog
cd "$BUILDDIR"
git clone "$REPOURL" "$NAME"
cd "$NAME"
if [ "$VERSION" = "_auto_" ] ; then
VERSION=$(newest_git_tag)
fi
git verify-tag "$VERSION"
git checkout "$VERSION"
mv ../debian/ .
VERSION_CHANGELOG=$( echo $VERSION | sed -e 's/v//g')
sed -e "s/NAME_PLACEHOLDER/$NAME/g" -i ./debian/changelog
sed -e "s/VERSION_PLACEHOLDER/$VERSION_CHANGELOG/g" -i ./debian/changelog
DATE_CHANGELOG=$(date -R)
sed -e "s/DATE_PLACEHOLDER/$DATE_CHANGELOG/g" -i ./debian/changelog
dpkg-buildpackage --no-sign
cp -a ../*.deb "$TARGET_DIR"/
}

4
repo.conf Normal file
查看文件

@ -0,0 +1,4 @@
APT::FTPArchive::Release::Codename "default";
APT::FTPArchive::Release::Components "main";
APT::FTPArchive::Release::Label "quitesimple.org apt repository";
APT::FTPArchive::Release::Architectures "amd64";

14
update_repo Executable file
查看文件

@ -0,0 +1,14 @@
#!/bin/bash
set -u
source ./CONFIG
mkdir -p repo/dists
mkdir -p repo/pool
mkdir -p repo/dists/default/main/binary-amd64/
cd repo
dpkg-scanpackages -a amd64 pool > ./dists/default/main/binary-amd64/Packages
cd dists/default/
apt-ftparchive -c ../../../repo.conf release . > Release
gpg -a --yes --clearsign --output InRelease --local-user "$SIGNING_KEY_EMAIL" --detach-sign Release
cd ../../../
rsync -aAXPv --delete repo/ "$TARGET_SERVER":"$TARGET_PATH"
ssh "$TARGET_SERVER" chown -R "$TARGET_OWNER" "$TARGET_PATH"