1 # Perl Audio Converter 2 # 3 # Copyright (C) 2005-2021 Philip Lyons (vorzox@gmail.com) 4 # 5 # This program is free software; you can redistribute it and/or modify 6 # it under the terms of the GNU General Public License as published by 7 # the Free Software Foundation; either version 3 of the License, or 8 # (at your option) any later version. 9 # 10 # This program is distributed in the hope that it will be useful, 11 # but WITHOUT ANY WARRANTY; without even the implied warranty of 12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 # GNU General Public License for more details. 14 # 15 # You should have received a copy of the GNU General Public License 16 # along with this program. If not, see <http://www.gnu.org/licenses/>. 17 18 PACKAGE_NAME = @PACKAGE_NAME@ 19 PACKAGE_VERSION = @PACKAGE_VERSION@ 20 21 ACLOCAL_M4 = ./aclocal.m4 22 23 # 24 # Modules & Documentation 25 # 26 27 DOCS = INSTALL README AUTHORS TODO NEWS ChangeLog COPYING 28 29 LANG_MODS = po/* 30 EXTRAS = extra/* 31 32 # 33 # Plugin directories 34 # 35 36 NAUTILUS_PLUGIN_DIR = plugins/gnome/nautilus 37 NEMO_PLUGIN_DIR = plugins/gnome/nemo 38 KDE_PLUGIN_DIR = plugins/kde 39 40 # 41 # Default KDE directory 42 # 43 44 DESTDIR = 45 KDEDIR = /usr 46 GNOMEDIR = /usr 47 48 # 49 # Target KDE directories 50 # 51 52 KDE_INSTALL_DIR = $(DESTDIR)$(KDEDIR)/share/kde4/services 53 NAUTILUS_INSTALL_DIR = $(DESTDIR)$(HOME)/.local/share/nautilus/scripts 54 NEMO_INSTALL_DIR = $(DESTDIR)$(GNOMEDIR)/share/nemo/actions 55 ICON_DIR = $(DESTDIR)$(GNOMEDIR)/share/icons 56 57 # 58 # Compiler tools definitions... 59 # 60 61 POD2MAN = @POD2MAN@ 62 POD2HTML = @POD2HTML@ 63 GZIP = @GZIP@ 64 RM = @RM@ -f 65 SHELL = /bin/sh 66 67 # 68 # Configuration files directories and other 69 # 70 CONF_DIR = $(DESTDIR)$(sysconfdir)/$(PACKAGE_NAME) 71 PO_DIR = $(DESTDIR)$(pkgdatadir)/locale 72 MOD_DIR = $(CONF_DIR)/modules 73 DOC_DIR = $(DESTDIR)$(docdir) 74 MAN_DIR = $(DESTDIR)$(mandir)/man1 75 EXTRA_DIR = $(CONF_DIR)/extra 76 77 edit = sed \ 78 -e 's|@pkgdatadir[@]|$(pkgdatadir)|g' \ 79 -e 's|@sysconfdir[@]|$(sysconfdir)|g' 80 81 all : pacpl.1.gz 82 83 pacpl: pacpl.in Makefile 84 rm -f $@ $@.tmp 85 $(edit) '$@.in' >$@.tmp 86 mv $@.tmp $@ 87 chmod +x $@ 88 89 pacpl.1.gz : pacpl 90 $(POD2MAN) $< | $(GZIP) -9 > $@ 91 touch $@ 92 93 install: all main install-plugins 94 95 main: 96 $(INSTALL) -d $(DESTDIR)$(bindir) 97 $(INSTALL) -d $(CONF_DIR) 98 $(INSTALL) -d $(PO_DIR) 99 $(INSTALL) -d $(MOD_DIR) 100 $(INSTALL) -d $(MAN_DIR) 101 $(INSTALL) -d $(DOC_DIR) 102 $(INSTALL) -d $(EXTRA_DIR) 103 104 $(INSTALL) pacpl $(DESTDIR)$(bindir) 105 $(INSTALL_DATA) pacpl.conf codecs.conf pacpl.png $(CONF_DIR) 106 $(INSTALL_DATA) $(LANG_MODS) $(PO_DIR) 107 $(INSTALL_DATA) pacpl.1.gz $(MAN_DIR) 108 $(INSTALL_DATA) $(DOCS) $(DOC_DIR) 109 $(INSTALL_DATA) $(EXTRAS) $(EXTRA_DIR) 110 111 install-plugins: 112 113 if INSTALL_KDE 114 $(INSTALL) -d $(KDE_INSTALL_DIR) 115 $(INSTALL) $(KDE_PLUGIN_DIR)/PACPL-Konvert $(DESTDIR)$(bindir) 116 $(INSTALL_DATA) $(KDE_PLUGIN_DIR)/pacpl.desktop $(KDE_INSTALL_DIR) 117 sed -i 's/KDE_DIR = 0/KDE_DIR = 1/' $(CONF_DIR)/pacpl.conf 118 sed -i 's/KDE_OPTS = 0/KDE_OPTS = 1/' $(CONF_DIR)/pacpl.conf 119 endif 120 121 if INSTALL_NAUTILUS 122 $(INSTALL) -d $(NAUTILUS_INSTALL_DIR) 123 $(INSTALL) $(NAUTILUS_PLUGIN_DIR)/PACPL-Convert $(NAUTILUS_INSTALL_DIR) 124 endif 125 126 if INSTALL_NEMO 127 $(INSTALL) -d $(NEMO_INSTALL_DIR) 128 $(INSTALL) $(NEMO_PLUGIN_DIR)/PACPL-Convert $(NEMO_INSTALL_DIR) 129 $(INSTALL_DATA) $(NEMO_PLUGIN_DIR)/pacpl.nemo_action $(NEMO_INSTALL_DIR) 130 $(INSTALL_DATA) $(NEMO_PLUGIN_DIR)/pacpl.png $(ICON_DIR) 131 endif 132 133 if ENABLE_GNOME_NAUTILUS 134 sed -i 's/ZEN_DIR = 0/ZEN_DIR = 1/' $(CONF_DIR)/pacpl.conf 135 sed -i 's/ZEN_OPTS = 0/ZEN_OPTS = 1/' $(CONF_DIR)/pacpl.conf 136 endif 137 138 if ENABLE_GNOME_NEMO 139 sed -i 's/ZEN_DIR = 0/ZEN_DIR = 1/' $(CONF_DIR)/pacpl.conf 140 sed -i 's/ZEN_OPTS = 0/ZEN_OPTS = 1/' $(CONF_DIR)/pacpl.conf 141 endif 142 143 clean: 144 $(RM) pacpl.1.gz 145 146 distclean: clean 147 $(RM) config.log 148 $(RM) config.status 149 $(RM) Makefile 150 $(RM) pacpl 151 find . -name '*~' -exec $(RM) '{}' \; 152 153 uninstall: uninstall-plugins 154 $(RM) $(DESTDIR)$(bindir)/pacpl 155 $(RM) $(MAN_DIR)/pacpl.1.gz 156 $(RM) -r $(CONF_DIR)/pacpl 157 $(RM) -r $(DOC_DIR)/pacpl 158 $(RM) -r $(DESTDIR)$(pkgdatadir) 159 160 uninstall-plugins: 161 if INSTALL_KDE 162 $(RM) $(KDE_INSTALL_DIR)/pacpl.desktop 163 $(RM) $(DESTDIR)$(bindir)/PACPL-Konvert 164 endif 165 166 if INSTALL_NAUTILUS 167 $(RM) $(NAUTILUS_INSTALL_DIR)/PACPL-Convert 168 endif 169 170 if INSTALL_NEMO 171 $(RM) $(NEMO_INSTALL_DIR)/PACPL-Convert 172 $(RM) $(NEMO_INSTALL_DIR)/pacpl.nemo_action 173 $(RM) $(ICON_DIR)/pacpl.png 174 endif