View | Details | Raw Unified | Return to bug 193484 | Differences between
and this patch

Collapse All | Expand All

(-)refdb/Makefile (-37 / +24 lines)
Lines 3-9 Link Here
3
3
4
PORTNAME=	refdb
4
PORTNAME=	refdb
5
PORTVERSION=	0.9.9
5
PORTVERSION=	0.9.9
6
PORTREVISION=	6
6
PORTREVISION=	7
7
CATEGORIES=	textproc
7
CATEGORIES=	textproc
8
MASTER_SITES=	SF/${PORTNAME}/${PORTNAME}-src/${PORTNAME}-src-${PORTVERSION}-1
8
MASTER_SITES=	SF/${PORTNAME}/${PORTNAME}-src/${PORTNAME}-src-${PORTVERSION}-1
9
DISTNAME=	${PORTNAME}-${PORTVERSION}-1
9
DISTNAME=	${PORTNAME}-${PORTVERSION}-1
Lines 15-30 Link Here
15
		libbtparse.so:${PORTSDIR}/textproc/btparse \
15
		libbtparse.so:${PORTSDIR}/textproc/btparse \
16
		libdbi.so:${PORTSDIR}/databases/libdbi
16
		libdbi.so:${PORTSDIR}/databases/libdbi
17
17
18
USES=		gmake iconv perl5
18
USES=		gmake iconv readline perl5 libtool pkgconfig pathfix shebangfix
19
HAS_CONFIGURE=	yes
19
HAS_CONFIGURE=	yes
20
ALL_TARGET=
20
ALL_TARGET=
21
21
22
CFLAGS+=	-I${LOCALBASE}/include
22
CFLAGS+=	-I${LOCALBASE}/include -m64
23
23
CFLAGS+=-fPIC
24
CONFIGURE_ARGS+=	--with-expat-lib=${LOCALBASE}/lib
24
CXXFLAGS+=-fPIC
25
CONFIGURE_ARGS+=	--with-classpath-root=${PREFIX}/share/java/classes
25
26
CONFIGURE_ARGS+=	--with-refdb-url=http://localhost/refdb
26
CONFIGURE_ARGS+=	--with-expat-lib=${LOCALBASE}/lib \
27
DOCSDIR=	${PREFIX}/share/doc/${PORTNAME}-${PORTVERSION}-1
27
			--with-classpath-root=${PREFIX}/share/java/classes \
28
			--with-refdb-url=http://localhost/refdb
29
DOCSDIR=	${STAGEDIR}${PREFIX}/share/doc/${PORTNAME}-${PORTVERSION}-1
28
30
29
XMLCATMGR=	${LOCALBASE}/bin/xmlcatmgr
31
XMLCATMGR=	${LOCALBASE}/bin/xmlcatmgr
30
32
Lines 34-56 Link Here
34
OPTIONS_SINGLE_DB=	MYSQL PGSQL SQLITE
36
OPTIONS_SINGLE_DB=	MYSQL PGSQL SQLITE
35
CATALOG_DESC=	Install SGML catalog
37
CATALOG_DESC=	Install SGML catalog
36
38
37
OPTIONS_DEFAULT=	MYSQL
39
OPTIONS_DEFAULT=	PGSQL
40
41
SHEBANG_FILES=          ${WRKSRC}/scripts/*
38
42
39
MAN1=	bib2ris.1 bib2ris-utf8.1 db2ris.1 eenc.1 en2ris.1 marc2ris.1 med2ris.1 \
43
USE_RC_SUBR=            refdbd
40
	refdb-backup.1 refdb-bug.1 refdb-ms.1 refdb-restore.1 \
41
	refdb_dos2unix.1 refdb_latex2utf8txt.1 refdba.1 \
42
	refdbc.1 refdbctl.1 refdbd.1 refdbib.1 refdbjade.1 \
43
	refdbnd.1 refdbxml.1 refdbxp.1 runbib.1 \
44
	refdb-sruserver.1 refdbsru.1
45
#MAN7=	RefDB.7
46
MAN8=	refdb.8 refdb.sh.8 refdb-init.8
47
44
48
NO_STAGE=	yes
49
.include <bsd.port.pre.mk>
45
.include <bsd.port.pre.mk>
50
.include <bsd.port.options.mk>
46
.include <bsd.port.options.mk>
51
47
52
.if ${PORT_OPTIONS:MMYSQL}
48
.if ${PORT_OPTIONS:MMYSQL}
53
USE_MYSQL=	yes
49
USES+=  mysql
54
# If libdbi-drivers has been built without MySQL driver, abort
50
# If libdbi-drivers has been built without MySQL driver, abort
55
.if exists(${LOCALBASE}/lib/dbd) && !exists(${LOCALBASE}/lib/dbd/libdbdmysql.so)
51
.if exists(${LOCALBASE}/lib/dbd) && !exists(${LOCALBASE}/lib/dbd/libdbdmysql.so)
56
IGNORE=		rebuild databases/libdbi-drivers with MySQL support
52
IGNORE=		rebuild databases/libdbi-drivers with MySQL support
Lines 60-66 Link Here
60
CONFIGURE_ARGS+=	--with-db-server=mysql
56
CONFIGURE_ARGS+=	--with-db-server=mysql
61
57
62
.elif ${PORT_OPTIONS:MPGSQL}
58
.elif ${PORT_OPTIONS:MPGSQL}
63
USE_PGSQL=	yes
59
USES+=  pgsql
64
# If libdbi-drivers has been built without PostgreSQL driver, abort
60
# If libdbi-drivers has been built without PostgreSQL driver, abort
65
.if exists(${LOCALBASE}/lib/dbd) && !exists(${LOCALBASE}/lib/dbd/libdbdpgsql.so)
61
.if exists(${LOCALBASE}/lib/dbd) && !exists(${LOCALBASE}/lib/dbd/libdbdpgsql.so)
66
IGNORE=		rebuild databases/libdbi-drivers with PostgreSQL support
62
IGNORE=		rebuild databases/libdbi-drivers with PostgreSQL support
Lines 72-78 Link Here
72
.elif ${PORT_OPTIONS:MSQLITE}
68
.elif ${PORT_OPTIONS:MSQLITE}
73
LIB_DEPENDS+=	libsqlite3.so:${PORTSDIR}/databases/sqlite3
69
LIB_DEPENDS+=	libsqlite3.so:${PORTSDIR}/databases/sqlite3
74
# If libdbi-drivers has been built without SQLite driver, abort
70
# If libdbi-drivers has been built without SQLite driver, abort
75
.if exists(${LOCALBASE}/lib/dbd) && !exists(${LOCALBASE}/lib/dbd/libdbdsqlite.so)
71
.if exists(${LOCALBASE}/lib/dbd) && !exists(${LOCALBASE}/lib/dbd/libdbdsqlite3.so)
76
IGNORE=		rebuild databases/libdbi-drivers with SQLite support
72
IGNORE=		rebuild databases/libdbi-drivers with SQLite support
77
.elif !exists(${LOCALBASE}/lib/dbd)
73
.elif !exists(${LOCALBASE}/lib/dbd)
78
BUILD_DEPENDS+=	${LOCALBASE}/lib/dbd:${PORTSDIR}/databases/libdbi-drivers
74
BUILD_DEPENDS+=	${LOCALBASE}/lib/dbd:${PORTSDIR}/databases/libdbi-drivers
Lines 86-93 Link Here
86
82
87
post-install:
83
post-install:
88
.if ${PORT_OPTIONS:MCATALOG}
84
.if ${PORT_OPTIONS:MCATALOG}
89
	@[ -f ${PREFIX}/share/sgml/catalog.ports ] || ${TOUCH} ${PREFIX}/share/sgml/catalog.ports
85
	@[ -f ${STAGEDIR}${PREFIX}/share/sgml/catalog.ports ] || ${TOUCH} ${STAGEDIR}${PREFIX}/share/sgml/catalog.ports
90
	@${XMLCATMGR} -s -c ${PREFIX}/share/sgml/catalog.ports lookup "${PREFIX}/share/refdb/refdb.cat" > /dev/null || ${XMLCATMGR} -s -c ${PREFIX}/share/sgml/catalog.ports add CATALOG "${PREFIX}/share/refdb/refdb.cat" -- > /dev/null
86
	@${XMLCATMGR} -s -c ${STAGEDIR}${PREFIX}/share/sgml/catalog.ports lookup "${STAGEDIR}${PREFIX}/share/refdb/refdb.cat" > /dev/null || ${XMLCATMGR} -s -c ${STAGEDIR}${PREFIX}/share/sgml/catalog.ports add CATALOG "${STAGEDIR}${PREFIX}/share/refdb/refdb.cat" -- > /dev/null
91
.endif
87
.endif
92
	@${ECHO_MSG} "To complete RefDB installation:"
88
	@${ECHO_MSG} "To complete RefDB installation:"
93
.if ${PORT_OPTIONS:MMYSQL}
89
.if ${PORT_OPTIONS:MMYSQL}
Lines 98-132 Link Here
98
	@${ECHO_MSG} ""
94
	@${ECHO_MSG} ""
99
	@${ECHO_MSG} "   Then, for MySQL older than 4.1, run:"
95
	@${ECHO_MSG} "   Then, for MySQL older than 4.1, run:"
100
	@${ECHO_MSG} ""
96
	@${ECHO_MSG} ""
101
	@${ECHO_MSG} "   mysql -u root refdb < ${PREFIX}/share/refdb/sql/refdb.dump.mysql"
97
	@${ECHO_MSG} "   mysql -u root refdb < ${STAGEDIR}${PREFIX}/share/refdb/sql/refdb.dump.mysql"
102
	@${ECHO_MSG} ""
98
	@${ECHO_MSG} ""
103
	@${ECHO_MSG} "   For MySQL 4.1 and later, run:"
99
	@${ECHO_MSG} "   For MySQL 4.1 and later, run:"
104
	@${ECHO_MSG} ""
100
	@${ECHO_MSG} ""
105
	@${ECHO_MSG} "   mysql -u root refdb < ${PREFIX}/share/refdb/sql/refdb.dump.mysql41"
101
	@${ECHO_MSG} "   mysql -u root refdb < ${STAGEDIR}${PREFIX}/share/refdb/sql/refdb.dump.mysql41"
106
	@${ECHO_MSG} ""
102
	@${ECHO_MSG} ""
107
.elif ${PORT_OPTIONS:MPGSQL}
103
.elif ${PORT_OPTIONS:MPGSQL}
108
	@${ECHO_MSG} ""
104
	@${ECHO_MSG} ""
109
	@${ECHO_MSG} "1. To initialise PostgreSQL, run the following commands:"
105
	@${ECHO_MSG} "1. To initialise PostgreSQL, run the following commands:"
110
	@${ECHO_MSG} ""
106
	@${ECHO_MSG} ""
111
	@${ECHO_MSG} "   createdb -U pgsql -E UNICODE refdb"
107
	@${ECHO_MSG} "   createdb -U pgsql -E UNICODE refdb"
112
	@${ECHO_MSG} "   psql -U pgsql refdb < ${PREFIX}/share/refdb/sql/refdb.dump.pgsql"
108
	@${ECHO_MSG} "   psql -U pgsql refdb < ${STAGEDIR}${PREFIX}/share/refdb/sql/refdb.dump.pgsql"
113
	@${ECHO_MSG} ""
109
	@${ECHO_MSG} ""
114
.elif ${PORT_OPTIONS:MSQLITE}
110
.elif ${PORT_OPTIONS:MSQLITE}
115
	@${ECHO_MSG} ""
111
	@${ECHO_MSG} ""
116
	@${ECHO_MSG} "1. To initialise SQLite, run the following commands:"
112
	@${ECHO_MSG} "1. To initialise SQLite, run the following commands:"
117
	@${ECHO_MSG} ""
113
	@${ECHO_MSG} ""
118
	@${ECHO_MSG} "   cd ${PREFIX}/share/refdb/db"
114
	@${ECHO_MSG} "   cd ${STAGEDIR}${PREFIX}/share/refdb/db"
119
	@${ECHO_MSG} "   sqlite refdb < ${PREFIX}/share/refdb/sql/refdb.dump.sqlite"
115
	@${ECHO_MSG} "   sqlite refdb < ${STAGEDIR}${PREFIX}/share/refdb/sql/refdb.dump.sqlite"
120
	@${ECHO_MSG} ""
116
	@${ECHO_MSG} ""
121
.endif
117
.endif
122
	@${INSTALL_SCRIPT} -m 755 ${WRKSRC}/scripts/refdb ${PREFIX}/etc/rc.d/refdb.sh.dist
123
	@${ECHO_MSG} "2. To run refdbd at system startup, rename the startup script:"
124
	@${ECHO_MSG} ""
125
	@${ECHO_MSG} "   mv ${PREFIX}/etc/rc.d/refdb.sh.dist ${PREFIX}/etc/rc.d/refdb.sh"
126
	@${ECHO_MSG} ""
127
	@${ECHO_MSG} "3. Customise the configuration scripts in ${PREFIX}/etc/refdb,"
128
	@${ECHO_MSG} "   as described in the RefDB documentation at:"
129
	@${ECHO_MSG} ""
130
	@${ECHO_MSG} "   http://refdb.sourceforge.net/manual/x593.html#SECT1-MYSTERY-INIT-FILES"
131
118
132
.include <bsd.port.post.mk>
119
.include <bsd.port.post.mk>
(-)refdb/files/refdbd.in (+84 lines)
Line 0 Link Here
1
#!/bin/sh
2
#
3
# $FreeBSD$
4
#
5
# O. Hartmann, Berlin, 2014
6
#
7
#
8
# PROVIDE: refdbd
9
# REQUIRE: LOGIN
10
# KEYWORD: shutdown
11
#
12
# To enable this service, place
13
#
14
# refdbd_enable="YES"
15
#
16
# in /etc/rc.conf[.local]
17
# 
18
# and optionally set the the following variables upon your environment:
19
#
20
# Choose another PIDFILE as the configured and/or default one:
21
# refdbd_pidfile="/var/run/refdbd.pid"
22
#
23
# To make the refdbd daemon accessible local only (127.0.0.1):
24
# refdbd_local="YES"
25
26
. /etc/rc.subr
27
28
name="refdbd"
29
rcvar=refdbd_enable
30
31
# read settings, set defaults
32
load_rc_config ${name}
33
34
command="%%PREFIX%%/bin/${name}"
35
globalconfig="%%PREFIX%%/etc/refdb/refdbdrc"
36
pidfile="/var/run/${name}.pid"
37
extra_commands="reload"
38
39
load_rc_config ${name}
40
41
: ${refdbd_enable:="NO"}
42
: ${refdbd_local:="NO"}
43
44
if checkyesno refdbd_local; then
45
  refdbd_local_flags="-I"
46
else
47
  refdbd_local_flags=""
48
fi
49
50
start_precmd="${name}_prestart"
51
52
refdbd_prestart()
53
{
54
	local	refdbvar refdbval
55
56
	# Check whether we have configured a PID file
57
	if [ "x${refdbd_pidfile}" != "x" ]; then
58
		pidfile="${refdbd_pidfile}"
59
60
	# ... if not configured via rc.conf[.local],
61
	# read the settings in the configure file. We're only interested in
62
	# nonstandard PID file settings
63
	else
64
		for config in ${globalconfig}; do
65
			while read refdbvar refdbval; do
66
				if [ -n "${refdbvar}" ]; then
67
					if [ ${refdbvar}="pidfile" ]; then
68
						pidfile=${refdbval}
69
					fi
70
				fi
71
			done < $config
72
		done
73
	fi
74
75
	piddir=`dirname ${pidfile}`
76
	mkdir -p ${piddir}
77
78
	refdbd_pid_flags="-P ${pidfile}"
79
}
80
81
# Set command arguments upon configuration
82
command_args="${refdbd_local_flags} ${refdbd_pid_flags}"
83
84
run_rc_command "$1"

Return to bug 193484