summaryrefslogtreecommitdiffstats
path: root/misc/linux-opengroupware/Makefile
blob: 7934c677d2cc210567d90c67fceddab6c2ed26ed (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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
# New ports collection makefile for:	linux-opengroupware.org
# Date created:				2003-07-20
# Whom:					Frank Reppin
#
# $FreeBSD$

PORTNAME=	opengroupware
PORTVERSION=	1.0
PORTREVISION=	4
CATEGORIES=	misc www linux
MASTER_SITES=	http://download.opengroupware.org/nightly/packages/freebsd/linux-opengroupware/RPMS/:ogo \
		http://download.opengroupware.org/nightly/packages/freebsd/linux-opengroupware/NGOBJWEB/:ngo \
		${MASTER_SITE_REDHAT_LINUX}
MASTER_SITE_SUBDIR=	updates/8.0/en/os/${MACHINE_ARCH}
PKGNAMEPREFIX=	linux-
DISTFILES=	${SET1} \
		${SET2} \
		${SET3}
EXTRACT_ONLY=	${NGOBJWEB_ADAPTOR}

MAINTAINER=	frank@opengroupware.org
COMMENT=	Groupware package including mail, calendar, palm sync and much more

EXTRACT_DEPENDS=	rpm2cpio:${PORTSDIR}/archivers/rpm
RUN_DEPENDS=	${LOCALBASE}/sbin/apxs:${PORTSDIR}/www/apache20 \
		${LOCALBASE}/bin/bash:${PORTSDIR}/shells/bash2 \
		${LOCALBASE}/bin/gmake:${PORTSDIR}/devel/gmake

USE_PGSQL=	yes

#BEGINSET1

SET1=		opengroupware-core-4.2-ogo107.i386.rpm:ogo \
		opengroupware-core-tools-4.2-ogo107.i386.rpm:ogo \
		opengroupware-database-1.0-ogo022.i386.rpm:ogo \
		opengroupware-docapi-1.0-ogo101.i386.rpm:ogo \
		opengroupware-env-1.0-ogo016.i386.rpm:ogo \
		opengroupware-epoz-0.6.1-ogo003.i386.rpm:ogo \
		opengroupware-gstep-db-4.2-ogo042.i386.rpm:ogo \
		opengroupware-gstep-db-postgresql72-4.2-ogo042.i386.rpm:ogo \
		opengroupware-gstep-make-4.2-ogo009.i386.rpm:ogo \
		opengroupware-gstep-objc-2.95.3-ogo011.i386.rpm:ogo \
		opengroupware-js-1.5-ogo013.i386.rpm:ogo \
		opengroupware-libfoundation-1.0.25-ogo049.i386.rpm:ogo \
		opengroupware-libical-0.23.0-ogo010.i386.rpm:ogo \
		opengroupware-libxml2-2.6.11-ogo002.i386.rpm:ogo \
		opengroupware-libxslt-1.1.8-ogo002.i386.rpm:ogo \
		opengroupware-logic-1.0-ogo112.i386.rpm:ogo \
		opengroupware-nhsc-1.0-ogo001.i386.rpm:ogo \
		opengroupware-pda-1.0-ogo033.i386.rpm:ogo \
		opengroupware-pilot-link-0.10.99-ogo008.i386.rpm:ogo \
		opengroupware-plr-1.0-ogo008.i386.rpm:ogo \
		opengroupware-publisher-1.0-ogo020.i386.rpm:ogo \
		opengroupware-sope-4.2-ogo163.i386.rpm:ogo \
		opengroupware-theme-blue-de-1.0-ogo039.i386.rpm:ogo \
		opengroupware-theme-blue-en-1.0-ogo039.i386.rpm:ogo \
		opengroupware-theme-default-de-1.0-ogo039.i386.rpm:ogo \
		opengroupware-theme-default-dk-1.0-ogo039.i386.rpm:ogo \
		opengroupware-theme-default-en-1.0-ogo039.i386.rpm:ogo \
		opengroupware-theme-default-es-1.0-ogo039.i386.rpm:ogo \
		opengroupware-theme-default-it-1.0-ogo039.i386.rpm:ogo \
		opengroupware-theme-kde-en-1.0-ogo039.i386.rpm:ogo \
		opengroupware-theme-ooo-de-1.0-ogo039.i386.rpm:ogo \
		opengroupware-theme-ooo-en-1.0-ogo039.i386.rpm:ogo \
		opengroupware-theme-orange-de-1.0-ogo039.i386.rpm:ogo \
		opengroupware-theme-orange-en-1.0-ogo039.i386.rpm:ogo \
		opengroupware-tools-account-1.0-ogo031.i386.rpm:ogo \
		opengroupware-tools-aptnotify-1.0-ogo031.i386.rpm:ogo \
		opengroupware-tools-bulkmessages-1.0-ogo031.i386.rpm:ogo \
		opengroupware-tools-installsieve-1.0-ogo031.i386.rpm:ogo \
		opengroupware-webui-admin-1.0-ogo032.i386.rpm:ogo \
		opengroupware-webui-app-1.0-ogo054.i386.rpm:ogo \
		opengroupware-webui-common-1.0-ogo087.i386.rpm:ogo \
		opengroupware-webui-contact-1.0-ogo072.i386.rpm:ogo \
		opengroupware-webui-forms-1.0-ogo016.i386.rpm:ogo \
		opengroupware-webui-job-1.0-ogo037.i386.rpm:ogo \
		opengroupware-webui-libs-1.0-ogo059.i386.rpm:ogo \
		opengroupware-webui-mailer-1.0-ogo077.i386.rpm:ogo \
		opengroupware-webui-news-1.0-ogo018.i386.rpm:ogo \
		opengroupware-webui-prefs-1.0-ogo038.i386.rpm:ogo \
		opengroupware-webui-project-1.0-ogo077.i386.rpm:ogo \
		opengroupware-webui-resource-de-1.0-ogo132.i386.rpm:ogo \
		opengroupware-webui-resource-dk-1.0-ogo132.i386.rpm:ogo \
		opengroupware-webui-resource-en-1.0-ogo132.i386.rpm:ogo \
		opengroupware-webui-resource-es-1.0-ogo132.i386.rpm:ogo \
		opengroupware-webui-resource-fr-1.0-ogo132.i386.rpm:ogo \
		opengroupware-webui-resource-it-1.0-ogo132.i386.rpm:ogo \
		opengroupware-webui-resource-nl-1.0-ogo132.i386.rpm:ogo \
		opengroupware-webui-resource-pt_BR-1.0-ogo132.i386.rpm:ogo \
		opengroupware-webui-scheduler-1.0-ogo080.i386.rpm:ogo \
		opengroupware-xml-4.2-ogo066.i386.rpm:ogo \
		opengroupware-xml-STXSaxDriver-4.2-ogo066.i386.rpm:ogo \
		opengroupware-xml-icalsaxdriver-4.2-ogo066.i386.rpm:ogo \
		opengroupware-xml-libxmlsaxdriver-4.2-ogo066.i386.rpm:ogo \
		opengroupware-xmlrpcd-1.0-ogo049.i386.rpm:ogo \
		opengroupware-zidestore-1.2-ogo082.i386.rpm:ogo
#ENDSET1

SET2=		${NGOBJWEB_ADAPTOR}:ngo
SET3=		postgresql-libs-7.2.4-5.80.i386.rpm \
		openssl-0.9.6b-35.8.i386.rpm \
		cyrus-sasl-2.1.10-1.i386.rpm \
		openldap-2.0.27-2.8.0.i386.rpm \
		pam-0.75-46.8.0.i386.rpm \
		krb5-libs-1.2.5-15.i386.rpm

NGOBJWEB_ADAPTOR=	opengroupware.org-mod_ngobjweb-200407092000.tar.gz
PATCHDIR?=	${MASTERDIR}/files
USE_LINUX=	yes
USE_GMAKE=	yes
MAKEFILE=	${WRKSRC}/opengroupware.org-mod_ngobjweb/GNUmakefile
BUILD_WRKSRC?=	${WRKSRC}/opengroupware.org-mod_ngobjweb
NGWEB_ADAP_DIR=	opengroupware.org-mod_ngobjweb
PKGNAME_PREFIX=	linux-

ONLY_FOR_ARCHS=	i386
NO_PACKAGE=	We dont really build anything ...
DIST_SUBDIR=	ogo
PLIST=		${WRKDIR}/pkg-plist
MD5_FILE=	${MASTERDIR}/distinfo.${MACHINE_ARCH}
PREFIX=		${LINUXBASE}

.include <bsd.port.pre.mk>

RPM2CPIO?=	${LOCALBASE}/bin/rpm2cpio
CPIOFLAGS=	--extract --make-directories --no-absolute-filenames \
		--preserve-modification-time --quiet
RPMDIR=		${DISTDIR}/${DIST_SUBDIR}

REMOVEFILES=	.md5sum .md5sum.changes \
		${NGOBJWEB_ADAPTOR} \
		etc/rc.d/init.d/saslauthd \
		usr/sbin/dbconverter-2 \
		usr/sbin/saslauthd \
		usr/sbin/sasldblistusers \
		usr/sbin/sasldblistusers2 \
		usr/sbin/saslpasswd \
		usr/sbin/saslpasswd2 \
		sbin/pam_console_apply \
		sbin/pam_tally \
		sbin/pam_timestamp_check \
		sbin/pwdb_chkpwd \
		sbin/unix_chkpwd \
		etc/krb5.conf \
		etc/rc.d/init.d/kdcrotate \
		usr/bin/openssl

REMOVEDIRS=	${NGWEB_ADAP_DIR} \
		etc/openldap \
		usr/share/openldap \
		usr/kerberos/share

do-extract:
	@${RM} -rf ${WRKDIR}
	@${MKDIR} ${WRKSRC}
	@${CP} ${DISTDIR}/${DIST_SUBDIR}/${EXTRACT_ONLY} ${WRKSRC}
	@(cd ${WRKSRC} && ${TAR} xfz ${EXTRACT_ONLY})

	@for myfile in ${SET1} ${SET3}; do \
		ourfile=`${ECHO} $$myfile |${SED} -e 's/:ogo//'`; \
		${ECHO} "Extracting for: $$ourfile"; \
		(cd ${WRKSRC} && ${RPM2CPIO} ${RPMDIR}/$$ourfile | ${CPIO} ${CPIOFLAGS}); \
	done

post-build:
	${INSTALL} ${COPY} -m 644 ${WRKSRC}/${NGWEB_ADAP_DIR}/ngobjweb*.so ${WRKSRC}/opt/opengroupware.org

	@for delfile in ${REMOVEFILES}; do \
		${ECHO} "Removing unecessary file in ${WRKSRC}: $$delfile"; \
		${RM} -f ${WRKSRC}/$$delfile; \
	done

	@for deldir in ${REMOVEDIRS}; do \
		${ECHO} "Removing unecessary dir in ${WRKSRC}: $$deldir"; \
		${RM} -rf ${WRKSRC}/$$deldir; \
	done

.if !defined(EXTRACT_PRESERVE_OWNERSHIP)
	@if [ `id -u` = 0 ]; then \
		${CHMOD} -R ug-s ${WRKDIR}; \
		${CHOWN} -R 0:0 ${WRKDIR}; \
	fi
.endif

pre-install:
	${RM} -f ${PLIST}
	cd ${WRKSRC} && ${FIND} -s . -type f -o -type l | \
		${CUT} -c3-999 >> ${PLIST} \
		&& ${FIND} -d * -type d | ${SED} -e 's:^:@dirrm :' >> ${PLIST}

do-install:
	cd ${WRKSRC} && ${FIND} * | ${CPIO} -dlmp ${PREFIX}
	${FIND} ${PREFIX} -type d \! -ipath '${LINUXBASE}/proc*' -exec ${CHMOD} 755 \{\} \;

post-install:
	@${MKDIR} ${LINUXBASE}/opt/opengroupware.org/documents
	@${CHMOD} 750 ${LINUXBASE}/opt/opengroupware.org/documents
	@${MKDIR} ${LINUXBASE}/opt/opengroupware.org/news
	@${CHMOD} 750 ${LINUXBASE}/opt/opengroupware.org/news
	@${ECHO} '/opt/skyrix/system/Libraries/ix86/linux-gnu/gnu-fd-nil' >>${LINUXBASE}/etc/ld.so.conf
	@${ECHO} '/opt/opengroupware.org/Libraries/ix86/linux-gnu/gnu-fd-nil' >>${LINUXBASE}/etc/ld.so.conf
	@${ECHO} '/usr/kerberos/lib' >>${LINUXBASE}/etc/ld.so.conf
	@${LN} -sf ${LINUXBASE}/usr/lib/libpq.so.2 ${LINUXBASE}/usr/lib/libpq.so.3
	@${LN} -sf ${LINUXBASE}/lib/libssl.so.0.9.6b ${LINUXBASE}/lib/libssl.so.9.6
	@${LN} -sf ${LINUXBASE}/lib/ibcrypto.so.0.9.6b ${LINUXBASE}/lib/libcrypto.so.2
	@${PREFIX}/sbin/ldconfig
	@${SH} ${PKGDIR}/pkg-install ${PKGNAME} POST-INSTALL
	@${CHOWN} -Rh ogo:skyrix ${LINUXBASE}/opt/skyrix
	@${CHOWN} -Rh ogo:skyrix ${LINUXBASE}/opt/opengroupware.org
	@${INSTALL} -d -m 770 -o ogo -g skyrix /var/log/opengroupware
	@${CHOWN} -Rh ogo:skyrix /var/log/opengroupware
	@${INSTALL} -m 640 -o ogo -g skyrix ${FILESDIR}/OpenGroupware.org.sh.tmpl ${LINUXBASE}/opt/opengroupware.org/OpenGroupware.org.sh
	@${SH} ${PKGDIR}/pkg-install ${PKGNAME} WRITE-DEFAULTS-FIRSTTIME
	@${SH} ${PKGDIR}/pkg-install ${PKGNAME} COPY-TEMPLATES
	@${CHOWN} -Rh ogo:skyrix ${LINUXBASE}/opt/opengroupware.org/.libFoundation
	@${INSTALL} -m 500 -o root -g wheel ${FILESDIR}/ogo.sh.sample ${LOCALBASE}/etc/rc.d/ogo.sh.sample
	@${INSTALL} -m 500 -o root -g wheel ${FILESDIR}/zidestore.sh.sample ${LOCALBASE}/etc/rc.d/zidestore.sh.sample
	@${INSTALL} -m 500 -o root -g wheel ${FILESDIR}/xmlrpcd.sh.sample ${LOCALBASE}/etc/rc.d/xmlrpcd.sh.sample
	@${INSTALL} -m 500 -o root -g wheel ${FILESDIR}/nhsd.sh.sample ${LOCALBASE}/etc/rc.d/nhsd.sh.sample
	@${PERL} ${SCRIPTDIR}/patch_apache_version.pl
	@${CHOWN} -Rh ogo:skyrix ${LINUXBASE}/opt/opengroupware.org/OpenGroupware.org.apacheinclude
	@${INSTALL} -m 444 -o ogo -g skyrix ${FILESDIR}/INSTALL.fbsd ${LINUXBASE}/opt/opengroupware.org/INSTALL.fbsd
	@${ECHO} ''
	@fmt ${PKGMESSAGE}
	@${ECHO} ''

.include <bsd.port.post.mk>
OpenPOWER on IntegriCloud