1 include GNUmakefile.defaults
2 VERSION:=$(shell cat VERSION)
9 ## Step 2: install files
10 install: all install-core install-plugins
12 # Directories required for stand-alone plugin install
14 $(INSTALL) -d -m 00755 $(DESTDIR)$(pkgdatadir)/
15 $(INSTALL) -d -m 00755 $(DESTDIR)$(pkgdatadir)/cronjobs/
16 $(INSTALL) -d -m 00755 $(DESTDIR)$(pkgdatadir)/plugins/
17 $(INSTALL) -d -m 00755 $(DESTDIR)$(pkgdatadir)/post-install.d/
18 $(INSTALL) -d -m 00755 $(DESTDIR)$(config_path)/config.ini.d/
19 $(INSTALL) -d -m 00755 $(DESTDIR)$(config_path)/httpd.conf.d/
20 $(INSTALL) -d -m 00755 $(DESTDIR)$(config_path)/plugins/
21 $(INSTALL) -d -m 00755 $(DESTDIR)$(sysconfdir)/cron.d/
22 $(INSTALL) -d -m 00755 $(DESTDIR)$(data_path)/
24 install-config: install-base-dirs
25 # Install initial configuration (without overwriting)
26 # Required for post-install scripts
27 $(CP_R) --no-clobber etc/config.ini.d/* $(DESTDIR)$(config_path)/config.ini.d/
28 if [ ! -e $(DESTDIR)$(config_path)/config.ini ]; then \
30 -e 's,@source_path@,$(pkgdatadir),' \
31 -e 's,@gettext_path@,$(localedir),' \
32 -e 's,@data_path@,$(data_path),' \
33 -e 's,@config_path@,$(config_path),' \
34 -e 's,@log_path@,$(log_path),' \
35 -e 's,@apache_user@,$(apache_user),' \
36 -e 's,@apache_group@,$(apache_group),' \
37 -e 's,@apache_service@,$(apache_service),' \
38 > $(DESTDIR)$(config_path)/config.ini; \
41 install-common: install-config install-plugin-authbuiltin
42 $(MAKE) -C locale DESTDIR=$(DESTDIR) PREFIX=$(PREFIX) install
43 $(CP_R) VERSION bin common templates lib $(DESTDIR)$(pkgdatadir)/
44 $(CP_R) cronjobs/scm $(DESTDIR)$(pkgdatadir)/cronjobs/ # no dedicated 'scm' package now
45 $(CP_R) post-install.d/common $(DESTDIR)$(pkgdatadir)/post-install.d/
46 $(INSTALL) -d -m 00755 $(DESTDIR)$(prefix)/bin/
47 ln -nfs $(pkgdatadir)/bin/forge_get_config $(DESTDIR)$(prefix)/bin/
48 ln -nfs $(pkgdatadir)/bin/forge_run_job $(DESTDIR)$(prefix)/bin/
49 ln -nfs $(pkgdatadir)/bin/forge_run_plugin_job $(DESTDIR)$(prefix)/bin/
50 ln -nfs $(pkgdatadir)/bin/forge_make_admin $(DESTDIR)$(prefix)/bin/
51 ln -nfs $(pkgdatadir)/bin/forge_set_password $(DESTDIR)$(prefix)/bin/
52 $(INSTALL) -d -m 00755 $(DESTDIR)$(log_path)/
54 install-db-local: install-db
55 install-db: install-base-dirs
56 $(CP_R) db $(DESTDIR)$(pkgdatadir)/
57 $(CP_R) cronjobs/db $(DESTDIR)$(pkgdatadir)/cronjobs/
58 $(CP_R) post-install.d/db $(DESTDIR)$(pkgdatadir)/post-install.d/
60 install-web: install-base-dirs
61 $(CP_R) vendor www $(DESTDIR)$(pkgdatadir)/
62 $(INSTALL) -d -m 00700 $(DESTDIR)$(data_path)/docman/
63 $(INSTALL) -d -m 00700 $(DESTDIR)$(data_path)/download/
64 $(INSTALL) -d -m 00700 $(DESTDIR)$(data_path)/forum/
65 $(INSTALL) -d -m 00700 $(DESTDIR)$(data_path)/tracker/
66 $(CP_R) post-install.d/web $(DESTDIR)$(pkgdatadir)/post-install.d/
68 install-shell: install-base-dirs
69 $(CP_R) cronjobs/shell $(DESTDIR)$(pkgdatadir)/cronjobs/
70 $(CP_R) post-install.d/shell $(DESTDIR)$(pkgdatadir)/post-install.d/
72 install-mta-postfix: install-base-dirs
73 $(CP_R) post-install.d/mta-postfix $(DESTDIR)$(pkgdatadir)/post-install.d/
75 install-mta-exim4: install-base-dirs
76 $(CP_R) post-install.d/mta-exim4 $(DESTDIR)$(pkgdatadir)/post-install.d/
78 install-lists: install-base-dirs
79 $(CP_R) cronjobs/lists $(DESTDIR)$(pkgdatadir)/cronjobs/
81 install-core: install-base-dirs install-common install-web install-db
83 PLUGINS:=$(shell utils/list-valid-plugins.sh)
84 PLUGINS_INSTALL_TARGETS=$(addprefix install-plugin-,$(PLUGINS))
85 install-plugins: $(PLUGINS_INSTALL_TARGETS)
87 install-plugin-%: plugins/% install-base-dirs
89 $(INSTALL) -d -m 00755 $(DESTDIR)$(pkgdatadir)/plugins/$*/
90 cd plugins/$* && $(CP_R) $$(ls | grep -v '^(etc|packaging)$$') $(DESTDIR)$(pkgdatadir)/plugins/$*/
91 # Initial config files
92 $(CP_R) plugins/$*/etc/$*.ini $(DESTDIR)$(config_path)/config.ini.d/; \
93 if [ -d plugins/$*/etc/plugins/$* ]; then \
94 $(CP_R) --no-clobber plugins/$*/etc/plugins/$* $(DESTDIR)$(config_path)/plugins/; \
96 if [ -d plugins/$*/etc/cron.d ]; then \
97 $(CP_R) --no-clobber plugins/$*/etc/cron.d/* $(DESTDIR)$(sysconfdir)/cron.d/; \
100 if [ -e plugins/$*/GNUmakefile ]; then $(MAKE) -C plugins/$*/ install; fi
103 rm -rf $(DESTDIR)$(pkgdatadir)
104 $(MAKE) -C locale/ uninstall
105 # Not removing $(config_path) and $(data_path) on purpose
108 ## Step 3: configure & update system
109 # not relying on 'prefix' for post-install (for no-install/dev setups)
110 fgc_source_path:=$(shell forge_get_config source_path 2>/dev/null)
111 post-install: post-install-core post-install-plugins
112 post-install-core: # common+db+web
113 $(fgc_source_path)/post-install.d/core.sh
116 $(fgc_source_path)/post-install.d/shell/shell.sh configure
118 PLUGINS_INSTALLED:=$(wildcard $(fgc_source_path)/plugins)
119 PLUGINS_POST_INSTALL_TARGETS=$(addprefix post-install-plugin-,$(PLUGINS_INSTALLED))
120 post-install-plugins: $(PLUGINS_POST_INSTALL_TARGETS)
121 post-install-plugin-%: $(fgc_source_path)/plugins/%/
122 $(fgc_source_path)/post-install.d/common/plugin.sh $* configure
125 ## TODO: make uninstall? make purge?
130 # not removing pre-built .mo files in e.g. 'debclean'
132 $(MAKE) -C locale/ clean
138 # depends: gettext tar
139 TAR_PREFIX=fusionforge-$(VERSION)
141 rm -rf $(TAR_PREFIX)/
143 $(CP_R) $$(ls -A | grep -v '^\.git' | grep -v $(TAR_PREFIX)) $(TAR_PREFIX)/
144 find $(TAR_PREFIX)/ -name '*~' -print0 | xargs -r0 rm
145 tar cjf $(TAR_PREFIX).tar.bz2 $(TAR_PREFIX)/
146 rm -rf $(TAR_PREFIX)/