Skip to content

Commit

Permalink
[dev] new release of acme.sh, renaming of package, and a lot of other…
Browse files Browse the repository at this point in the history
… changes, see debian/chanbgelog
  • Loading branch information
vincib committed Oct 7, 2021
1 parent d36e96a commit 2a47531
Show file tree
Hide file tree
Showing 15 changed files with 115 additions and 68 deletions.
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
debian/tmp/
debian/.debhelper/
debian/acme-sh/
debian/debhelper-build-stamp
debian/files
debian/acme-sh.debhelper.log
14 changes: 0 additions & 14 deletions Makefile

This file was deleted.

14 changes: 8 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
# acme.sh-debian

This projects helps to package [acme.sh](https://github.com/neilpang/acme.sh) as a Debian archive (.deb). acme.sh actually has a pretty good installer (`acme.sh --install`) but if you want to use a (personal) APT repository (e.g. with using [unattended-upgrades](https://packages.debian.org/stretch/unattended-upgrades)) this could help make it easier to install. Also this could be used to create a package that already holds your personal configuration files.
This projects helps to package [acme.sh](https://github.com/acmesh-official/acme.sh) as a Debian archive (.deb). acme.sh actually has a pretty good installer (`acme.sh --install`) but if you want to use a (personal) APT repository (e.g. with using [unattended-upgrades](https://packages.debian.org/stretch/unattended-upgrades)) this could help make it easier to install. Also this could be used to create a package that already holds your personal configuration files.

The resulting package will do the following:

1. Install `acme.sh` and all library files (`dnsapi/`, `deploy/` and `notify`) in `/usr/lib/acme.sh`
2. Install `account.conf` in `/etc/acme.sh/account.conf`
3. Set `/etc/acme.sh/cert` as the location for certificates (via `$CERT_HOME`)
4. Install the cronjob for renewing the certificates as `root`
5. Set up an alias for root (`alias acme.sh=/usr/lib/acme.sh/acme.sh`)
3. Set `/etc/acme.sh/cert` as the location for certificates (via `$CERT_HOME` in `account.conf`)
4. Install the cronjob for renewing the certificates obtained as `root`
5. Set up an alias for root (`alias acme.sh=acme.sh --home /etc/acme.sh`)

# Configure

Expand All @@ -18,8 +18,10 @@ After you've adapted the package update the changelog with `dch` (which also det

# Build

Build the package using `make debian` in the main directory.
Build the package using `debuild` in the main directory.

# Install

Install the resulting package with `dpkg -i` or add it to your personal APT repository
Install the resulting package with `dpkg -i` or add it to your personal APT repository via `dput`


5 changes: 0 additions & 5 deletions account-etc.conf
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,3 @@
#NO_TIMESTAMP=1
LOG_FILE="/var/log/acme.sh/acme.sh.log"
CERT_HOME="$LE_CONFIG_HOME/cert"
ACCOUNT_KEY_PATH="$LE_CONFIG_HOME/account.key"
ACCOUNT_EMAIL="[email protected]"
ACMEPROXY_ENDPOINT="https://acmeproxy.mdbraber.net"

Le_DNSSleep=120
3 changes: 0 additions & 3 deletions acme.sh.env

This file was deleted.

4 changes: 4 additions & 0 deletions debian/acme-sh.cron.d
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@

# Renew all certificates obtained by root and located in /etc/acme.sh
0 15 * * * /usr/bin/acme.sh --cron --home "/etc/acme.sh/" > /dev/null

5 changes: 5 additions & 0 deletions debian/acme-sh.dirs
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
/usr/bin
/etc/acme.sh
/etc/ssl/acme.sh
/usr/lib/acme.sh
/var/log/acme.sh
18 changes: 18 additions & 0 deletions debian/acme-sh.postinst
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/bin/sh

set -e

case "$1" in
configure)
# Remove all existing alias
sed -i -e '/^alias acme\.sh="acme\.sh --home /etc/acme\.sh"$/d' /root/.bashrc
# Insert the updated line
echo 'alias acme.sh="acme.sh --home /etc/acme.sh"' >> /root/.bashrc
# Source it now
alias acme.sh="acme.sh --home /etc/acme.sh"
;;
esac

#DEBHELPER#

exit 0
14 changes: 14 additions & 0 deletions debian/acme-sh.postrm
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/bin/sh

set -e

case "$1" in
remove)
# Remove all existing alias
sed -i -e '/^alias acme\.sh="acme\.sh --home /etc/acme\.sh"$/d' /root/.bashrc
;;
esac

#DEBHELPER#

exit 0
2 changes: 2 additions & 0 deletions debian/acme-sh.substvars
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
misc:Depends=
misc:Pre-Depends=
20 changes: 0 additions & 20 deletions debian/acme.sh.postinst

This file was deleted.

14 changes: 13 additions & 1 deletion debian/changelog
Original file line number Diff line number Diff line change
@@ -1,6 +1,18 @@
acme-sh (3.0.1-1) stable; urgency=medium

* Upgrade to acme.sh 3.0.1
* Change the download to the new "acmesh-official" url & repository
* Add a License (GPL-v3) similar to acme.sh one.
* Replace the sourcing of acme.sh in /root/.bashrc by an alias
* Remove mdraber-specific default configuration
* Fix dependency to wget | curl
* Renaming of the package to follow debian convention

-- Benjamin Sonntag <[email protected]> Thu, 7 Oct 2021 12:03:12 +0200

acme.sh (0.1-2) stable; urgency=medium

* Fixed global install
* Fixed global install

-- Maarten den Braber <[email protected]> Sat, 11 May 2019 22:54:56 +0200

Expand Down
16 changes: 11 additions & 5 deletions debian/control
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
Source: acme.sh
Maintainer: Maarten den Braber <[email protected]>
Build-Depends: debhelper (>= 9), lsb-release, wget, dpkg-dev
Source: acme-sh
Maintainer: Benjamin Sonntag <[email protected]>
Build-Depends: debhelper (>= 10), lsb-release, wget
Standards-Version: 4.3.0

Package: acme.sh
Package: acme-sh
Architecture: any
Description: A pure Unix shell script implementing ACME client protocol
Description: Unix shell script implementing ACME client protocol
acme.sh is an ACME API client that can be used to get SSL/TLS certificates
from various ACME-compliant Certificate Authorities
such as Zerossl or Letsencrypt
Priority: optional
Section: web
Depends: wget | curl,
${misc:Depends}
23 changes: 23 additions & 0 deletions debian/copyright
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Upstream-Name: acme.sh
Source: https://github.com/acmesh-official/acme.sh
Files: *
Copyright: © 2016-2021 Neilpang.
License: GPL-3+
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3, or (at your option)
any later version.
.
This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
02110-1301, USA.
.
On Debian systems, the complete text of the GNU General Public License
can be found in /usr/share/common-licenses/GPL-3.
25 changes: 11 additions & 14 deletions debian/rules
Original file line number Diff line number Diff line change
Expand Up @@ -2,37 +2,34 @@

VERSION := $(shell dpkg-parsechangelog -S version)

DEB_HOST_ARCH := $(DEB_TARGET_ARCH)
PACKAGEVERSION := $(VERSION)
#BINARY := acme.sh # Expect compiled binary in our local directory.
GITHUBUSER := mdbraber
GITHUBUSER := acmesh-official
PROJECT := acme.sh
BRANCH := update-acmeproxy
BRANCH := 3.0.1


%:
dh_clean
dh $@

override_dh_strip:
# don't perform dh_strip
# don't perform dh_strip
echo dh_strip

override_dh_auto_clean:
override_dh_auto_test:
override_dh_auto_build:
override_dh_auto_install:
mkdir -p debian/tmp debian/acme.sh/usr/bin debian/acme.sh/etc/acme.sh debian/acme.sh/etc/ssl/acme.sh debian/acme.sh/usr/lib/acme.sh/ debian/acme.sh/var/log/acme.sh
mkdir -p debian/tmp
wget -P debian/tmp http://github.com/$(GITHUBUSER)/$(PROJECT)/archive/$(BRANCH).tar.gz
tar xzvf debian/tmp/$(BRANCH).tar.gz -C debian/tmp
cp -Rf debian/tmp/$(PROJECT)-$(BRANCH)/acme.sh debian/acme.sh/usr/lib/acme.sh/
cp -Rf debian/tmp/$(PROJECT)-$(BRANCH)/deploy/ debian/acme.sh/usr/lib/acme.sh/
cp -Rf debian/tmp/$(PROJECT)-$(BRANCH)/dnsapi/ debian/acme.sh/usr/lib/acme.sh/
cp -Rf debian/tmp/$(PROJECT)-$(BRANCH)/notify/ debian/acme.sh/usr/lib/acme.sh/
cp account-lib.conf debian/acme.sh/usr/lib/acme.sh/account.conf
cp account-etc.conf debian/acme.sh/etc/acme.sh/account.conf
cp acme.sh.env debian/acme.sh/etc/acme.sh/
ln -s ../lib/acme.sh/acme.sh debian/acme.sh/usr/bin/acme.sh
cp -Rf debian/tmp/$(PROJECT)-$(BRANCH)/acme.sh debian/acme-sh/usr/lib/acme.sh/
cp -Rf debian/tmp/$(PROJECT)-$(BRANCH)/deploy/ debian/acme-sh/usr/lib/acme.sh/
cp -Rf debian/tmp/$(PROJECT)-$(BRANCH)/dnsapi/ debian/acme-sh/usr/lib/acme.sh/
cp -Rf debian/tmp/$(PROJECT)-$(BRANCH)/notify/ debian/acme-sh/usr/lib/acme.sh/
cp account-lib.conf debian/acme-sh/usr/lib/acme.sh/account.conf
cp account-etc.conf debian/acme-sh/etc/acme.sh/account.conf
ln -s ../lib/acme.sh/acme.sh debian/acme-sh/usr/bin/acme.sh

override_dh_gencontrol:
dh_gencontrol -- -v$(PACKAGEVERSION)

0 comments on commit 2a47531

Please sign in to comment.