Skip to content

Commit

Permalink
Merge branch 'master' of github.com:24eme/signaturepdf
Browse files Browse the repository at this point in the history
  • Loading branch information
wincelau committed Sep 6, 2024
2 parents 105a5ab + b7fd794 commit 73f896d
Show file tree
Hide file tree
Showing 12 changed files with 118 additions and 53 deletions.
18 changes: 15 additions & 3 deletions .debian/apache.conf
Original file line number Diff line number Diff line change
@@ -1,12 +1,24 @@
# signaturepdf default Apache configuration

Alias /signaturepdf /usr/share/signaturepdf/public
Alias /signaturepdf /~#LIBPATH#~public

DocumentRoot /usr/share/signaturepdf/public
DocumentRoot /~#LIBPATH#~public
AddDefaultCharset UTF-8

<Directory /usr/share/signaturepdf/public>
<Directory /~#LIBPATH#~public>
Options SymLinksIfOwnerMatch
DirectoryIndex index.php
AllowOverride All

<IfVersion >= 2.3>
Require all granted
</IfVersion>
<IfVersion < 2.3>
Order Deny,Allow
Allow from all
</IfVersion>
</Directory>

LogLevel warn
ErrorLog /var/log/apache2/ssp_error.log
CustomLog /var/log/apache2/ssp_access.log combined
7 changes: 7 additions & 0 deletions .debian/changelog
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
~#PKGNAME#~ (~#VERSION#~-~#RELEASE#~) UNRELEASED; urgency=low

* Please check the
https://github.com/~#VENDOR#~/~#PROJECT#~
commit history

-- ~#MAINTAINER#~ ~#DATE#~
1 change: 1 addition & 0 deletions .debian/compat
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
9
14 changes: 14 additions & 0 deletions .debian/control
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
Source: ~#PKGNAME#~
Maintainer: ~#MAINTAINER#~
Section: php
Priority: optional
Build-Depends: debhelper (>= 9)
Standards-Version: 3.9.7
Homepage: https://github.com/~#VENDOR#~/~#PROJECT#~
Vcs-Git: https://github.com/~#VENDOR#~/~#PROJECT#~.git

Package: ~#PKGNAME#~
Provides: php-~#PROJECT#~
Architecture: all
Depends: php (>= 7.4.0), pdftk, librsvg2-bin, imagemagick, potrace, ghostscript, locales, ${misc:Depends}
Description: Outils de signature PDF en ligne libre et open-source
20 changes: 20 additions & 0 deletions .debian/copyright
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Upstream-Name: ~#PROJECT#~
Source: https://github.com/~#VENDOR#~/~#PROJECT#~

Files: *
Copyright: Copyright 2021-2024 ~#MAINTAINER#~
License: AGPL-3

License: AGPL-3
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as
published by the Free Software Foundation, either version 3 of the
License, 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, see <http://www.gnu.org/licenses/> or
/usr/share/common-licenses/AGPL-3
10 changes: 5 additions & 5 deletions .debian/postinst
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@
set -e

# Droits sur les fichiers
chgrp -R www-data /usr/share/signaturepdf/data
chgrp -R www-data /usr/share/signaturepdf/pdf
chgrp -R www-data /~#LIBPATH#~data
chgrp -R www-data /~#LIBPATH#~pdf

chmod -R g+rwx /usr/share/signaturepdf/data
chmod -R g+rwx /usr/share/signaturepdf/pdf
chmod -R g+rwx /~#LIBPATH#~data
chmod -R g+rwx /~#LIBPATH#~pdf

# Activation de la conf apache2
mkdir -p /etc/apache2/conf-available
ln -sf ../../signaturepdf/apache.conf /etc/apache2/conf-available/signaturepdf.conf
ln -sf ../../~#PKGNAME#~/apache.conf /etc/apache2/conf-available/signaturepdf.conf

a2enconf signaturepdf
systemctl reload apache2
3 changes: 3 additions & 0 deletions .debian/rules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/usr/bin/make -f
%:
dh $@
1 change: 1 addition & 0 deletions .debian/source/format
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.0 (quilt)
45 changes: 0 additions & 45 deletions .github/workflows/build.yaml

This file was deleted.

41 changes: 41 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,20 @@

.DEFAULT_GOAL := all

VENDOR=24eme
PROJECT=signaturepdf
MAINTAINER=Équipe 24ème <[email protected]>
VERSION=$(shell git describe --abbrev=0)
RELEASE=$(shell git describe | cut -d- -f2)
PKGNAME=php-${PROJECT}
DATADIR=usr/share
LIBPATH=$(DATADIR)/$(PKGNAME)/
CONFIGPATH=etc/$(PKGNAME)/

CURRENTDIR=$(dir $(realpath $(firstword $(MAKEFILE_LIST))))
TARGETDIR=$(CURRENTDIR)target
PATHDEBPKG=$(TARGETDIR)/DEB

all: update_trad

node_modules/jest/bin/jest.js:
Expand Down Expand Up @@ -44,3 +58,30 @@ update_trad:
git add "$$lang/LC_MESSAGES/application_$$checksum.mo"; \
git add "locale/application_$$checksum.pot"; \
done

# Build a DEB package for Debian-like Linux distributions
.PHONY: deb
deb:
rm -rf $(TARGETDIR)
git clone . $(PATHDEBPKG)/$(PKGNAME)-$(VERSION)/$(LIBPATH)
rm -rf $(PATHDEBPKG)/$(PKGNAME)-$(VERSION)/$(LIBPATH).git
rm -rf $(PATHDEBPKG)/$(PKGNAME)-$(VERSION)/$(LIBPATH).debian
tar -zcvf $(PATHDEBPKG)/$(PKGNAME)_$(VERSION).orig.tar.gz -C $(PATHDEBPKG)/ $(PKGNAME)-$(VERSION)
rsync -av --exclude=*~ ./.debian/ $(PATHDEBPKG)/$(PKGNAME)-$(VERSION)/debian
mkdir -p $(PATHDEBPKG)/$(PKGNAME)-$(VERSION)/$(CONFIGPATH)
mv $(PATHDEBPKG)/$(PKGNAME)-$(VERSION)/debian/apache.conf $(PATHDEBPKG)/$(PKGNAME)-$(VERSION)/$(CONFIGPATH)
find $(PATHDEBPKG)/$(PKGNAME)-$(VERSION)/debian/ -type f -exec sed -i "s/~#DATE#~/`date -R`/" {} \;
find $(PATHDEBPKG)/$(PKGNAME)-$(VERSION)/debian/ -type f -exec sed -i "s/~#VENDOR#~/$(VENDOR)/" {} \;
find $(PATHDEBPKG)/$(PKGNAME)-$(VERSION)/debian/ -type f -exec sed -i "s/~#PROJECT#~/$(PROJECT)/" {} \;
find $(PATHDEBPKG)/$(PKGNAME)-$(VERSION)/debian/ -type f -exec sed -i "s/~#MAINTAINER#~/$(MAINTAINER)/" {} \;
find $(PATHDEBPKG)/$(PKGNAME)-$(VERSION)/ -type f -exec sed -i "s/~#PKGNAME#~/$(PKGNAME)/" {} \;
find $(PATHDEBPKG)/$(PKGNAME)-$(VERSION)/debian/ -type f -exec sed -i "s/~#VERSION#~/$(VERSION)/" {} \;
find $(PATHDEBPKG)/$(PKGNAME)-$(VERSION)/debian/ -type f -exec sed -i "s/~#RELEASE#~/$(RELEASE)/" {} \;
find $(PATHDEBPKG)/$(PKGNAME)-$(VERSION)/ -type f -exec sed -i "s|~#LIBPATH#~|$(LIBPATH)|" {} \;
echo $(LIBPATH) > $(PATHDEBPKG)/$(PKGNAME)-$(VERSION)/debian/$(PKGNAME).dirs
echo "$(LIBPATH)* $(LIBPATH)" > $(PATHDEBPKG)/$(PKGNAME)-$(VERSION)/debian/install
ifneq ($(strip $(CONFIGPATH)),)
echo $(CONFIGPATH) >> $(PATHDEBPKG)/$(PKGNAME)-$(VERSION)/debian/$(PKGNAME).dirs
echo "$(CONFIGPATH)* $(CONFIGPATH)" >> $(PATHDEBPKG)/$(PKGNAME)-$(VERSION)/debian/install
endif
cd $(PATHDEBPKG)/$(PKGNAME)-$(VERSION) && debuild -us -uc
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ Open-source software under the AGPL V3 license.
- [Debian/Ubuntu](installation.md#debian)
- [Docker](installation.md#docker)
- [Linux Alpine](installation.md#alpine)
- [Package](installation.md#package)

## Configuration

Expand Down
10 changes: 10 additions & 0 deletions installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -212,3 +212,13 @@ cat <<EOF >>/var/www/signaturepdf/config/config.ini
PDF_STORAGE_PATH=/var/www/signaturepdf/tmp
EOF
```

## [Package](#package)

You can also build a Debian (or Debian-like) package (`.deb`) by issuing the following command :
```
make deb
```

Make sure you have the `devscripts` package installed. The file will be in the newly created `target` directory.
You can also customize some parameters in the [Makefile](./Makefile)

0 comments on commit 73f896d

Please sign in to comment.