summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke Shumaker <LukeShu@sbcglobal.net>2014-06-23 20:58:18 -0400
committerLuke Shumaker <LukeShu@sbcglobal.net>2014-06-23 20:58:18 -0400
commit213a1ffca123ab7bf30ba3af57fff3c5e99f54ea (patch)
treec05b8b4e94365b8ae9b3e6da33d75d88e4a78ea4
parent07bbca11bee7e0ddae32f9e5db8bf03b72def4ab (diff)
clean up the build system
-rw-r--r--.gitignore7
-rw-r--r--Makefile59
-rw-r--r--[-rwxr-xr-x]parabolaweb-changepassword.real.in (renamed from parabolaweb-changepassword.sh)2
-rw-r--r--[-rwxr-xr-x]parabolaweb-fcgi.in (renamed from parabolaweb-fcgi)2
-rw-r--r--[-rwxr-xr-x]parabolaweb-reporead-inotify.in (renamed from parabolaweb-reporead-inotify)2
-rw-r--r--[-rwxr-xr-x]parabolaweb-update.in (renamed from parabolaweb-update)2
6 files changed, 46 insertions, 28 deletions
diff --git a/.gitignore b/.gitignore
index 52f4d7c..21b81d8 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,3 +1,6 @@
depends.txt
-*.service
-parabolaweb-changepassword
+
+parabolaweb*
+!parabolaweb*.in
+!parabolaweb*.c
+!parabolaweb.conf
diff --git a/Makefile b/Makefile
index 4abd3a5..d4e4bf0 100644
--- a/Makefile
+++ b/Makefile
@@ -1,44 +1,59 @@
-prefix = /usr
+DESTDIR =
+
+#prefix = /usr/local
+prefix = /usr
exec_prefix = $(prefix)
-sbindir = $(exec_prefix)/sbin
-libexecdir = $(exec_prefix)/lib
-systemddir = $(prefix)/lib/systemd/system
-confdir = /etc/conf.d
+bindir = $(exec_prefix)/bin
+#sbindir = $(exec_prefix)/sbin
+sbindir = $(bindir)
+#libexecdir = $(exec_prefix)/libexec
+libexecdir = $(exec_prefix)/lib
+#sysconfdir = $(prefix)/etc
+sysconfdir = /etc/conf.d
+systemddir = $(prefix)/lib/systemd/system
pkglibexecdir = $(libexecdir)/parabolaweb-utils
+pkgconffile = $(sysconfdir)/parabolaweb
CFLAGS += -std=c99 -Wall -Wextra -Werror -Wno-unused-parameter
CPPFLAGS += -DSCRIPT_LOCATION='"$(pkglibexecdir)/parabolaweb-changepassword.real"'
-all: depends.txt parabolaweb-changepassword
-
-install: \
+targets = \
$(DESTDIR)$(sbindir)/parabolaweb-changepassword \
$(DESTDIR)$(sbindir)/parabolaweb-fcgi \
$(DESTDIR)$(sbindir)/parabolaweb-reporead-inotify \
$(DESTDIR)$(sbindir)/parabolaweb-update \
- $(DESTDIR)$(confdir)/parabolaweb \
$(DESTDIR)$(pkglibexecdir)/parabolaweb-changepassword.real \
$(DESTDIR)$(systemddir)/parabolaweb.service \
$(DESTDIR)$(systemddir)/parabolaweb-reporead-inotify.service
-depends.txt: list-depends depends_static.txt
- bash $< > $@
+all: depends.txt $(notdir $(targets)) parabolaweb.conf
-%.service: %.service.in
- sed 's|@sbindir@|$(sbindir)|' < $< > $@
+install: $(targets) $(sysconffile)
-$(DESTDIR)$(sbindir)/%: %
- install -Dm755 $< $@
+# Pattern rules
-$(DESTDIR)$(sbindir)/parabolaweb-changepassword: parabolaweb-changepassword
- install -Dm6755 $< $@
+%: %.in
+ sed -e 's|@sbindir@|$(sbindir)|' -e 's|@pkgconffile@|$(pkgconffile)|' < $< > $@
+
+$(DESTDIR)$(sbindir)/%: %
+ $(INSTALL) -Dm755 $< $@
-$(DESTDIR)$(pkglibexecdir)/parabolaweb-changepassword.real: parabolaweb-changepassword.sh
- install -Dm755 $< $@
+$(DESTDIR)$(pkglibexecdir)/%: %
+ $(INSTALL) -Dm755 $< $@
$(DESTDIR)$(systemddir)/%.service: %.service
- install -Dm644 $< $@
+ $(INSTALL) -Dm644 $< $@
+
+# Specific rules
+
+depends.txt: list-depends depends_static.txt
+ $< > $@
+
+$(DESTDIR)$(sbindir)/parabolaweb-changepassword: parabolaweb-changepassword
+ $(INSTALL) -Dm6755 $< $@
+
+$(DESTDIR)(pkgconffile): parabolaweb.conf
+ $(INSTALL) -Dm644 $< $@
-$(DESTDIR)$(confdir)/%: %.conf
- install -Dm644 $< $@
+.DELETE_ON_ERROR:
diff --git a/parabolaweb-changepassword.sh b/parabolaweb-changepassword.real.in
index 04627c8..942ec66 100755..100644
--- a/parabolaweb-changepassword.sh
+++ b/parabolaweb-changepassword.real.in
@@ -23,7 +23,7 @@ usage() {
}
main() {
- . /etc/conf.d/parabolaweb
+ . @pkgconffile@
[[ -e "${WEBDIR}/manage.py" ]]
[[ -n "${WEBUSER}" ]]
diff --git a/parabolaweb-fcgi b/parabolaweb-fcgi.in
index 431c371..2c8b5bf 100755..100644
--- a/parabolaweb-fcgi
+++ b/parabolaweb-fcgi.in
@@ -15,7 +15,7 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-. /etc/conf.d/parabolaweb
+. @pkgconffile@
[[ -e "${WEBDIR}/manage.py" ]]
diff --git a/parabolaweb-reporead-inotify b/parabolaweb-reporead-inotify.in
index 4e11146..66934ea 100755..100644
--- a/parabolaweb-reporead-inotify
+++ b/parabolaweb-reporead-inotify.in
@@ -15,7 +15,7 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-. /etc/conf.d/parabolaweb
+. @pkgconffile@
[[ -e "${WEBDIR}/manage.py" ]]
[[ $# -eq 0 ]]
diff --git a/parabolaweb-update b/parabolaweb-update.in
index d5bcd18..6a2ad02 100755..100644
--- a/parabolaweb-update
+++ b/parabolaweb-update.in
@@ -15,7 +15,7 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-. /etc/conf.d/parabolaweb
+. @pkgconffile@
. libremessages
clean() {