summaryrefslogtreecommitdiff
path: root/graphics/cdlabelgen/patches/patch-ab
blob: df72191c7cb3c159e8291c521bdf9cc846907e97 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
$NetBSD: patch-ab,v 1.12 2015/02/05 11:29:48 mef Exp $

--- Makefile.orig	2013-04-01 04:37:51.000000000 +0900
+++ Makefile	2015-02-05 18:58:24.000000000 +0900
@@ -10,12 +10,12 @@ ZIPVERSION = 430
 # Change these to locations you need, also
 # remember to edit cdlabelgen and its @where_is_the_template as needed.
 
-BASE_DIR   = /usr
+BASE_DIR   = ${PREFIX}
 # BASE_DIR   = /usr/local
 # BASE_DIR   = /opt
 BIN_DIR   = $(BASE_DIR)/bin
 LIB_DIR   = $(BASE_DIR)/share/cdlabelgen
-MAN_DIR   = $(BASE_DIR)/share/man
+MAN_DIR   = $(BASE_DIR)/$(PKGMANDIR)
 WEBSOURCES= ../cdinsert.pl ../cdinsert-ps.pl ../cdlabelgen-form.html
 SOURCES    = cdlabelgen ChangeLog INSTALL README Makefile INSTALL.WEB cdlabelgen.pod cdlabelgen.1 cdlabelgen.html spec.template $(WEBSOURCES)
 POSTSCRIPT = template.ps *.eps
@@ -38,6 +38,14 @@ RPM_TOPDIR	:= $(HOME)/rpmbuild
 # ---------------
 
 all: cdlabelgen.html cdlabelgen.1
+	${SED} s=@PREFIX@=${PREFIX}=g <cdlabelgen >cdlabelgen.new
+	${MV} cdlabelgen.new cdlabelgen
+	if [ `id -u` -eq 0 ]; then	\
+		perldoc_flags="-U";	\
+	else				\
+		perldoc_flags="";	\
+	fi;				\
+	perldoc $$perldoc_flags cdlabelgen >cdlabelgen.0
 
 cdlabelgen.html: cdlabelgen.pod
 	pod2html --outfile=$@ --infile=$?
@@ -50,13 +58,13 @@ cdlabelgen.1: cdlabelgen.pod
 install: all
 	@echo "Installing cdlabelgen in $(BIN_DIR) and $(LIB_DIR)"
 	@echo ""
-	$(INSTALL_DIR) $(BIN_DIR)
-	$(INSTALL) cdlabelgen $(BIN_DIR)
-	$(INSTALL_FILE) cdlabelgen.1 $(MAN_DIR)/man1
-	$(INSTALL_DIR) $(LIB_DIR)
+
+	${BSD_INSTALL_SCRIPT} cdlabelgen ${DESTDIR}${BIN_DIR}
+	${BSD_INSTALL_MAN} cdlabelgen.1 ${DESTDIR}${PREFIX}/${PKGMANDIR}/man1
+	${BSD_INSTALL_DATA_DIR} ${DESTDIR}${LIB_DIR}
 	set -e; \
 	for file in $(POSTSCRIPT); do \
-		$(INSTALL_FILE) postscript/$$file $(LIB_DIR)/; \
+		${BSD_INSTALL_DATA} postscript/$$file ${DESTDIR}${LIB_DIR}; \
 	done
 	@echo "** Done. Check $(BIN_DIR)/cdlabelgen and fix @where_is_the_template - if needed!"