Project

General

Profile

IRONMAIDEN-808-FreeBSD.patch

Zimbra 8.0.8 CE Source FreeBSD patch - Daniel Curtis, 08/08/2014 12:41 PM

Download (140 KB)

View differences:

IRONMAIDEN-808.fbsd/ThirdParty/Makefile 2014-04-09 16:52:29.000000000 +0200
15 15
	include $(THIRDPARTY_ROOT)/versions.def
16 16
endif
17 17

  
18
MAKE := make
18
MAKE ?= make
19 19
ECHO := /bin/echo
20 20
MAKEARGS ?= -j5
21 21

  
......
55 55
	nginx \
56 56
	tcmalloc \
57 57
	libmemcached \
58
	libbsd \
59 58
	opendkim \
60 59
	altermime \
61 60
	zeromq
IRONMAIDEN-808.fbsd/ThirdParty/Perl/Makefile 2014-04-09 20:45:02.000000000 +0200
59 59
LDAP_INCLUDE 	:= $(ZIMBRA_HOME)/openldap/include
60 60
SASL_INCLUDE	:= $(ZIMBRA_HOME)/cyrus-sasl/include
61 61

  
62
#        ExtUtils::MakeMaker \
62 63
# Order is important here
63 64
PRE_PERL_LIBS	:= \
64 65
	Try::Tiny \
65 66
	Test::Simple \
66 67
	Test::Fatal \
67
	ExtUtils::MakeMaker \
68 68
	T/TO/TOKUHIROM/Test-Requires-0.06.tar.gz \
69 69
	CPAN::Meta::YAML \
70 70
	JSON::PP \
......
76 76
	parent \
77 77
	version \
78 78
	CPAN::Meta \
79
	ExtUtils::MakeMaker \
80 79
	Params::Util \
81 80
	List::MoreUtils \
82 81
	Sub::Install \
......
95 94
	Perl::OSType \
96 95
	Module::Metadata \
97 96
	ExtUtils::CBuilder \
98
	ExtUtils::ParseXS \
99 97
	Test::Harness \
100 98
	Pod::Simple \
101 99
	Pod::Man \
......
294 292
		$(PERL_SA_RULES) \
295 293
		$(PERL_BIN_TGZ_DEST)
296 294

  
295
ifeq (FreeBSD_amd64,$(BUILD_PLATFORM))
296
	# so that it actually compiles without local libraries being present
297
	export PERL5LIB := $(DEST_LIB_DIR)
298
	# Version::Requirements workaround, few tests will fail but who cares!
299
	export PERL_CORE := 1
300
	# less trouble to keep it in here
301
	MAKE := $(shell which gmake)
302
	# new version won't work with old perl-ldap (SSL verify)
303
	PERL_LIBS := $(PERL_LIBS) S/SU/SULLR/IO-Socket-SSL-1.79.tar.gz
304
	PRE_PERL_LIBS := HTTP::Request $(PRE_PERL_LIBS)
305
endif
306

  
307
# counters because i am impatient
308
# and because i was terribly bored while waiting for buildZCS.sh to complete
309
ALL_PERL_LIBS := \
310
	$(DBD_PERL_LIBS) \
311
	$(ZMQ_CONSTANTS) \
312
	$(ZMQ_LIB) \
313
	$(PERL_LDAP) \
314
	$(XML_PARSER) \
315
	$(LDAPAPI) \
316
	$(SWATCH) \
317
	$(SA_PERL_LIBS) \
318
	$(MAIL_SPF) \
319
	$(BDB_PERL_LIBS) \
320
	$(DBFILE_PERL_LIBS) \
321
	$(CRYPT_RSA) \
322
	$(CRYPT_RANDOM) \
323
	$(CRYPT_SSLeay) \
324
	$(NET_SSLeay) \
325
	$(PRE_PERL_LIBS) \
326
	$(PERL_LIBS)
327

  
328
COMPILE_COUNTER_FILE := $(TMPDIR)/.COMPILE_COUNTER_ACTUAL
329
COMPILE_COUNTER_TOTAL := $(shell echo $(ALL_PERL_LIBS) | wc -w | sed 's/ //g')
330
COMPILE_COUNTER_INCREMENT := echo "$$lib" >> $(COMPILE_COUNTER_FILE); wc -l $(COMPILE_COUNTER_FILE) | awk '{print $$1}' | tr -d '\n'; printf "/%d " $(COMPILE_COUNTER_TOTAL);
331

  
297 332
all: allclean setup $(DEST_LIB_DIR) $(DEST_BIN_DIR) $(PERL_TGZ_DEST_DIR) build check tarball
298 333

  
299
build:
300
	mkdir -p $(TMPDIR)
301
	@echo "Logging to $(LOGFILE)"
334
.PHONY: counter_init
335

  
336
counter_init:
337
	@mkdir -p $(TMPDIR)
338
	@echo -n "" > $(COMPILE_COUNTER_FILE)
302 339

  
340
build: counter_init
341
	@echo "We are going to compile $(COMPILE_COUNTER_TOTAL) Perl modules!"
342

  
343
	@mkdir -p $(TMPDIR)
344
	@echo "Logging to $(LOGFILE)"
303 345
	@for lib in $(CRYPT_SSLeay); do \
346
		$(COMPILE_COUNTER_INCREMENT) \
304 347
		echo -n "Compiling perl lib $$lib ..."; \
305 348
		cp $(PERL_ROOT)/$$lib.tar.gz $(TMPDIR); \
306 349
		(cd $(TMPDIR); tar xfz $$lib.tar.gz; cd $$lib; \
307
			patch -g0 -N -p1 < $(PERL_ROOT)/patches/crypt-ssleay-include.patch; \
350
			$(PATCH_BINARY) -g0 -N -p1 < $(PERL_ROOT)/patches/crypt-ssleay-include.patch; \
308 351
			$(PERL) -I$(DEST_LIB_DIR) Makefile.PL PREFIX=$(DEST_DIR) LIB=$(DEST_LIB_DIR) LIBS="-L$(ZIMBRA_HOME)/openssl-$(OPENSSL_VERSION)/lib -lssl -lcrypto -lz" LDFLAGS="-L$(ZIMBRA_HOME)/openssl-$(OPENSSL_VERSION)/lib -Wl,-rpath,$(ZIMBRA_HOME)/openssl-$(OPENSSL_VERSION)/lib" INC="-I$(ZIMBRA_HOME)/openssl-$(OPENSSL_VERSION)/include"; \
309 352
			LD_RUN_PATH="$(ZIMBRA_HOME)/openssl-$(OPENSSL_VERSION)/lib" $(MAKE); $(MAKE) install;) >>$(LOGFILE) 2>&1; \
310 353
		if [ $$? -ne 0 ]; then  echo "FAILED.";  else  echo "done.";  fi \
311 354
	done
312 355

  
313 356
	@for lib in $(CRYPT_RANDOM); do \
357
		$(COMPILE_COUNTER_INCREMENT) \
314 358
		echo -n "Compiling perl lib $$lib ..."; \
315 359
		cp $(PERL_ROOT)/$$lib.tar.gz $(TMPDIR); \
316 360
		(cd $(TMPDIR); tar xfz $$lib.tar.gz; cd $$lib; \
......
320 364
	done
321 365

  
322 366
	@for lib in $(CRYPT_RSA); do \
367
		$(COMPILE_COUNTER_INCREMENT) \
323 368
		echo -n "Compiling perl lib $$lib ..."; \
324 369
		cp $(PERL_ROOT)/$$lib.tar.gz $(TMPDIR); \
325 370
		(cd $(TMPDIR); tar xfz $$lib.tar.gz; cd $$lib; \
......
329 374
	done
330 375

  
331 376
	@for lib in $(PRE_PERL_LIBS); do \
377
		$(COMPILE_COUNTER_INCREMENT) \
332 378
		echo -n "Compiling perl lib $$lib ..."; \
333
		LDFLAGS="-fPIC" CFLAGS="-fPIC" BERKELEYDB_INCLUDE=$(BDB_INCLUDE) BERKELEYDB_LIB=$(BDB_LIB_DIR) $(PERL) -I$(DEST_LIB_DIR) -MCPAN -e "$$CPAN::Config->{make_arg}.=' CCCDLFLAGS="-fPIC" CFLAGS="-fPIC" LDFLAGS="-fPIC"'; $$CPAN::Config->{makepl_arg}.=' CCCDLFLAGS="-fPIC" CFLAGS="-fPIC" LDFLAGS="-fPIC"'; force (\"install\", \"$$lib\")" >> $(LOGFILE) 2>&1; \
379
		LDFLAGS="-fPIC" CFLAGS="-fPIC" BERKELEYDB_INCLUDE=$(BDB_INCLUDE) BERKELEYDB_LIB=$(BDB_LIB_DIR) $(PERL) -I$(DEST_LIB_DIR) -MCPAN -e "$$CPAN::Config->{make_arg}.=' CCCDLFLAGS="-fPIC" CFLAGS="-fPIC" LDFLAGS="-fPIC"'; $$CPAN::Config->{makepl_arg}.=' CCCDLFLAGS="-fPIC" CFLAGS="-fPIC" LDFLAGS="-fPIC"'; force notest (\"install\", \"$$lib\")" >> $(LOGFILE) 2>&1; \
334 380
		if [ $$? -ne 0 ]; then  echo "FAILED.";  else  echo "done.";  fi \
335 381
	done
336 382

  
337 383
	@for lib in $(NET_SSLeay); do \
384
		$(COMPILE_COUNTER_INCREMENT) \
338 385
		echo -n "Compiling perl lib $$lib ..."; \
339 386
		cp $(PERL_ROOT)/$$lib.tar.gz $(TMPDIR); \
340 387
		(cd $(TMPDIR); tar xfz $$lib.tar.gz; cd $$lib; \
......
344 391
	done
345 392
	
346 393
	@for lib in $(PERL_LDAP); do \
394
		$(COMPILE_COUNTER_INCREMENT) \
347 395
		echo -n "Compiling perl lib $$lib ..."; \
348 396
		cp $(PERL_ROOT)/$$lib.tar.gz $(TMPDIR); \
349 397
		(cd $(TMPDIR); tar xfz $$lib.tar.gz; cd $$lib; \
350
		patch -g0 -N -p1 < $(PERL_ROOT)/patches/net-ldap-keepalive.patch; \
351 398
		$(PERL) -I$(DEST_LIB_DIR) Makefile.PL PREFIX=$(DEST_DIR) LIB=$(DEST_LIB_DIR); \
352 399
		$(MAKE); $(MAKE) install;) >>$(LOGFILE) 2>&1; \
353 400
		if [ $$? -ne 0 ]; then  echo "FAILED.";  else  echo "done.";  fi \
354 401
	done
355 402
	
356 403
	@for lib in $(NET_SERVER); do \
404
		$(COMPILE_COUNTER_INCREMENT) \
357 405
		echo -n "Compiling perl lib $$lib ..."; \
358 406
		cp $(PERL_ROOT)/$$lib.tar.gz $(TMPDIR); \
359 407
		(cd $(TMPDIR); tar xfz $$lib.tar.gz; cd $$lib; \
......
363 411
	done
364 412
	
365 413
	@for lib in $(XML_PARSER); do \
414
		$(COMPILE_COUNTER_INCREMENT) \
366 415
		echo -n "Compiling perl lib $$lib ..."; \
367 416
		cp $(PERL_ROOT)/$$lib.tar.gz $(TMPDIR); \
368 417
		(cd $(TMPDIR); tar xfz $$lib.tar.gz; cd $$lib; \
......
372 421
	done
373 422

  
374 423
	@for lib in $(ZMQ_CONSTANTS); do \
424
		$(COMPILE_COUNTER_INCREMENT) \
375 425
		echo -n "Compiling perl lib $$lib ..."; \
376 426
		cp $(PERL_ROOT)/$$lib.tar.gz $(TMPDIR); \
377 427
		(cd $(TMPDIR); tar xfz $$lib.tar.gz; cd $$lib; \
......
381 431
	done
382 432

  
383 433
	@for lib in $(ZMQ_LIB); do \
434
		$(COMPILE_COUNTER_INCREMENT) \
384 435
		echo -n "Compiling perl lib $$lib ..."; \
385 436
		cp $(PERL_ROOT)/$$lib.tar.gz $(TMPDIR); \
386 437
		(cd $(TMPDIR); tar xfz $$lib.tar.gz; cd $$lib; \
387
		patch -g0 -N -p1 < $(PERL_ROOT)/patches/zmq-make.patch; \
438
		$(PATCH_BINARY) -g0 -N -p1 < $(PERL_ROOT)/patches/zmq-make.patch; \
388 439
		PKG_CONFIG_PATH=$(ZIMBRA_HOME)/zeromq-$(ZMQ_VERSION)/lib/pkgconfig ZMQ_HOME=$(ZIMBRA_HOME)/zeromq-$(ZMQ_VERSION) $(PERL) -I$(DEST_LIB_DIR) Makefile.PL PREFIX=$(DEST_DIR) LIB=$(DEST_LIB_DIR); \
389 440
		$(SED) -i .bak -e 's#^OTHERLDFLAGS = #OTHERLDFLAGS = -Wl,-rpath,$(ZIMBRA_HOME)/zeromq-$(ZMQ_VERSION)/lib#' Makefile; \
390 441
		$(MAKE); $(MAKE) install;) >>$(LOGFILE) 2>&1; \
......
392 443
	done
393 444

  
394 445
	@for lib in $(PERL_LIBS); do \
446
		$(COMPILE_COUNTER_INCREMENT) \
395 447
		echo -n "Compiling perl lib $$lib ..."; \
396
		LDFLAGS="-fPIC" CFLAGS="-fPIC" BERKELEYDB_INCLUDE=$(BDB_INCLUDE) BERKELEYDB_LIB=$(BDB_LIB_DIR) $(PERL) -I$(DEST_LIB_DIR) -MCPAN -e "$$CPAN::Config->{make_arg}.=' CCCDLFLAGS="-fPIC" CFLAGS="-fPIC" LDFLAGS="-fPIC"'; $$CPAN::Config->{makepl_arg}.=' CCCDLFLAGS="-fPIC" CFLAGS="-fPIC" LDFLAGS="-fPIC"'; force (\"install\", \"$$lib\")" >> $(LOGFILE) 2>&1; \
448
		LDFLAGS="-fPIC" CFLAGS="-fPIC" BERKELEYDB_INCLUDE=$(BDB_INCLUDE) BERKELEYDB_LIB=$(BDB_LIB_DIR) $(PERL) -I$(DEST_LIB_DIR) -MCPAN -e "$$CPAN::Config->{make_arg}.=' CCCDLFLAGS="-fPIC" CFLAGS="-fPIC" LDFLAGS="-fPIC"'; $$CPAN::Config->{makepl_arg}.=' CCCDLFLAGS="-fPIC" CFLAGS="-fPIC" LDFLAGS="-fPIC"'; force notest (\"install\", \"$$lib\")" >> $(LOGFILE) 2>&1; \
397 449
		if [ $$? -ne 0 ]; then  echo "FAILED.";  else  echo "done.";  fi \
398 450
	done
399 451

  
400 452
	@for lib in $(LDAPAPI); do \
453
		$(COMPILE_COUNTER_INCREMENT) \
401 454
		echo -n "Compiling perl lib $$lib ..."; \
402 455
		cp $(PERL_ROOT)/$$lib.tar.gz $(TMPDIR); \
403 456
		(cd $(TMPDIR); tar xfz $$lib.tar.gz; cd $$lib; \
......
408 461
	done
409 462

  
410 463
	@for lib in $(BDB_PERL_LIBS); do \
464
		$(COMPILE_COUNTER_INCREMENT) \
411 465
		echo -n "Compiling perl lib $$lib ..."; \
412 466
		cp $(PERL_ROOT)/$$lib.tar.gz $(TMPDIR); \
413 467
		(cd $(TMPDIR); tar xfz $$lib.tar.gz; cd $$lib; \
......
417 471
	done
418 472

  
419 473
	@for lib in $(DBFILE_PERL_LIBS); do \
474
		$(COMPILE_COUNTER_INCREMENT) \
420 475
		echo -n "Compiling perl lib $$lib ..."; \
421 476
		LD_RUN_PATH=$(ZIMBRA_HOME)/$(BDB_LIB_DIR) DB_FILE_INCLUDE=$(BDB_INCLUDE) DB_FILE_LIB=$(BDB_LIB_DIR) $(DB_FILE_ARGS) $(PERL) -I$(DEST_LIB_DIR) -MCPAN -e "force (\"install\", \"$$lib\")" >> $(LOGFILE) 2>&1; \
422 477
		if [ $$? -ne 0 ]; then  echo "FAILED.";  else  echo "done.";  fi \
423 478
	done
424 479

  
425 480
	@for lib in $(DBD_PERL_LIBS); do \
481
		$(COMPILE_COUNTER_INCREMENT) \
426 482
		echo -n "Compiling perl lib $$lib ..."; \
427 483
		cp $(PERL_ROOT)/$$lib.tar.gz $(TMPDIR); \
428 484
		(cd $(TMPDIR); tar xfz $$lib.tar.gz; cd $$lib; \
......
440 496
	done
441 497

  
442 498
	@for lib in $(MAIL_SPF); do \
499
		$(COMPILE_COUNTER_INCREMENT) \
443 500
		echo -n "Compiling perl lib $$lib ..."; \
444 501
		cp $(PERL_ROOT)/$$lib.tar.gz $(TMPDIR); \
445 502
		(cd $(TMPDIR); tar xfz $$lib.tar.gz; cd $$lib; \
......
450 507
	done
451 508

  
452 509
	@for lib in $(SA_PERL_LIBS); do \
510
		$(COMPILE_COUNTER_INCREMENT) \
453 511
		echo -n "Compiling perl lib $$lib" ...; \
454 512
		cp $(PERL_ROOT)/$$lib.tar.gz $(TMPDIR); \
455 513
		(cd $(TMPDIR); tar xzf $$lib.tar.gz; cd $$lib; \
......
471 529
	done
472 530

  
473 531
	@for lib in $(SWATCH); do \
532
		$(COMPILE_COUNTER_INCREMENT) \
474 533
		echo -n "Compiling perl lib $$lib ..."; \
475 534
		cp $(PERL_ROOT)/$$lib.tar.gz $(TMPDIR); \
476 535
		(cd $(TMPDIR); tar xzf $$lib.tar.gz; cd $$lib; \
IRONMAIDEN-808.fbsd/ThirdParty/Perl/MyConfig.pm.template 2014-04-09 14:28:32.000000000 +0200
1 1

  
2 2
$CPAN::Config = {
3
  'auto_commit' => q[0],
3 4
  'build_cache' => q[100],
4 5
  'build_dir' => q[@@BUILD_ROOT@@/.cpan/build],
5 6
  'bzip2' => q[@@BZIP2@@],
IRONMAIDEN-808.fbsd/ThirdParty/Perl/zmcheckbuiltmodules.pl 2014-04-09 14:28:32.000000000 +0200
26 26
my $exit_status=0;
27 27
my $pm;
28 28

  
29
my $uname = `uname`;
30
chomp($uname);
29 31
foreach my $m (@zmodules) {
30 32
  load_module($m);
31
  if ($INC{$pm} !~ /zimbramon\/lib/ && $INC{$pm} ne "") {
33
  if ($INC{$pm} !~ /zimbramon\/lib/ && $INC{$pm} ne "" && $uname ne 'FreeBSD') {
32 34
    print "$INC{$pm}\n";
33 35
    $exit_status=1;
34 36
  }
IRONMAIDEN-808.fbsd/ThirdParty/altermime/Makefile 2014-04-09 15:00:11.000000000 +0200
20 20
	BUILD_PLATFORM := "UNKNOWN"
21 21
endif
22 22

  
23
ALTMIME_PATCH := $(PATCH_BINARY) -g0 -p1 < ../patches/qpe.patch;
24

  
23 25
files	:= $(wildcard src/$(ALTMIME_NAME)-$(ALTMIME_VERSION).tar.gz)
24 26

  
25 27
all: checksrc allclean build check tar
......
33 35

  
34 36
build: $(ALTMIME_NAME)-$(ALTMIME_VERSION)
35 37
	(cd $(ALTMIME_NAME)-$(ALTMIME_VERSION); \
36
	patch -g0 -p1 < ../patches/qpe.patch; \
38
	$(ALTMIME_PATCH) \
37 39
	$(MYCC) $(MAKE))
38 40
	(mkdir -p $(INSTALL_PREFIX)/bin)
39 41
	(cp -f $(ALTMIME_NAME)-$(ALTMIME_VERSION)/LICENCE $(INSTALL_PREFIX)/LICENSE)
......
58 60
allclean: clean
59 61
	/bin/rm -rf $(ZIMBRA_HOME)/$(ALTMIME_NAME)-$(ALTMIME_VERSION)
60 62
	/bin/rm -rf $(ZIMBRA_HOME)/$(ALTMIME_NAME)
63
	/bin/rm -f $(ALTMIME_TGZ_TARGET)
IRONMAIDEN-808.fbsd/ThirdParty/apache-httpd/Makefile 2014-04-09 14:28:32.000000000 +0200
19 19
aprsrc	:= $(wildcard src/apr-$(APR_VERSION).tar.bz2)
20 20
aprutilsrc	:= $(wildcard src/apr-util-$(APR_UTIL_VERSION).tar.bz2)
21 21

  
22
LDFLAGS	:=	LDFLAGS="-L/opt/zimbra/convertd/lib -R/opt/zimbra/convertd/lib -L/opt/zimbra/openssl-$(OPENSSL_VERSION)/lib -R/opt/zimbra/openssl-$(OPENSSL_VERSION)/lib"
22
LDFLAGS	:=	LDFLAGS="-L/opt/zimbra/convertd/lib -R/opt/zimbra/convertd/lib -L$(OPENSSL_LIB_DIR) -R$(OPENSSL_LIB_DIR)"
23 23
ifeq ($(BUILD_PLATFORM), UBUNTU12_64)
24
LDFLAGS	:=	LDFLAGS="-L/opt/zimbra/convertd/lib -Wl,-rpath,/opt/zimbra/convertd/lib -L/opt/zimbra/openssl-$(OPENSSL_VERSION)/lib -Wl,-rpath,/opt/zimbra/openssl-$(OPENSSL_VERSION)/lib"
24
LDFLAGS	:=	LDFLAGS="-L/opt/zimbra/convertd/lib -Wl,-rpath,/opt/zimbra/convertd/lib -L$(OPENSSL_LIB_DIR) -Wl,-rpath,$(OPENSSL_LIB_DIR)"
25 25
endif
26 26

  
27 27
all: checksrc allclean build check
......
41 41
	mv apr-$(APR_VERSION) apr;)
42 42
	(cd httpd-$(HTTPD_VERSION)/srclib; tar xfj ../../src/apr-util-$(APR_UTIL_VERSION).tar.bz2; \
43 43
	mv apr-util-$(APR_UTIL_VERSION) apr-util;)
44
	(cd httpd-$(HTTPD_VERSION); $(ENVMOD) $(LDFLAGS) CFLAGS="-g -O2" ./configure --prefix=/opt/zimbra/httpd-$(HTTPD_VERSION) --enable-so --with-included-apr -with-mpm=event --enable-mpms-shared="all" --enable-ssl --with-ssl=/opt/zimbra/openssl-$(OPENSSL_VERSION); $(MAKE) $(MAKEARGS); $(MAKE) install)
44
	(cd httpd-$(HTTPD_VERSION); \
45
	$(ENVMOD) $(LDFLAGS) CFLAGS="-g -O2" ./configure --prefix=/opt/zimbra/httpd-$(HTTPD_VERSION) --enable-so --with-included-apr -with-mpm=event --enable-mpms-shared="all" --enable-ssl --with-ssl=$(OPENSSL_DIR); $(MAKE) $(MAKEARGS); $(MAKE) install)
45 46

  
46 47
tar:
47 48
	mkdir -p $(P4_ROOT)/ThirdPartyBuilds/$(BUILD_PLATFORM)/apache-httpd
IRONMAIDEN-808.fbsd/ThirdParty/buildThirdParty.sh 2014-04-09 14:28:32.000000000 +0200
25 25
PUBLIC=yes
26 26
OVERRIDE=no
27 27
ZIMBRA=no
28
MIRROR="http://cpan.yahoo.com/"
28
MIRROR="http://www.cpan.org/"
29
MAKE=make
30
PATCH=patch
31
CMAKE=cmake
29 32

  
30 33
usage() {
31 34
	echo ""
......
119 122
			CLEAN=yes
120 123
			shift;
121 124
			;;
125
		-t|--test)
126
			CLEAN=no
127
			TEST=yes
128
			OVERRIDE=yes
129
			shift;
130
			;;
122 131
		-o|--override)
123 132
			OVERRIDE=yes
124 133
			shift;
......
149 158
RELEASE=${PATHDIR%/*}
150 159
RELEASE=${RELEASE##*/}
151 160

  
152
if [ x$CLEAN = x"no" ]; then
161
if [ x$CLEAN = x"no" -a x$TEST != x"yes" ]; then
153 162
	echo "WARNING: You must supply the clean option -c"
154 163
	echo "WARNING: This will completely remove the contents of /opt/zimbra from the system"
155 164
	exit 1;
......
161 170

  
162 171
PLAT=`$PATHDIR/../ZimbraBuild/rpmconf/Build/get_plat_tag.sh`;
163 172

  
173
if [[ $PLAT = "FreeBSD"* ]]; then
174
	MAKE=gmake
175
	PATCH=gpatch
176
fi
177

  
164 178
if [ x$PLAT = "x" ]; then
165 179
	echo "Unknown platform, exiting."
166 180
	exit 1;
......
238 252
fi
239 253

  
240 254
echo "Checking for prerequisite binaries"
241
for req in autoconf autoheader automake libtool bison flex gcc g++ perl make patch wget bzip2 unzip cmake
255
for req in autoconf autoheader automake libtool bison flex gcc g++ perl $MAKE $PATCH wget bzip2 unzip cmake
242 256
do
243 257
	echo "	Checking $req"
244 258
	command=`which $req 2>/dev/null`
......
260 274
for req in $LIBREQ
261 275
do
262 276
	echo "	Checking $req"
263
	if [ ! -f "$LIBDIR/$req" ]; then
277
	if [[ $PLAT = "FreeBSD"* ]]; then
278
		command=`ldconfig -r | grep $req 2>/dev/null`
279
		RC=$?
280
		if [ $RC -ne 0 ]; then
281
			echo "Error: $req not found"
282
			exit 1;
283
		fi
284
	elif [ ! -f "$LIBDIR/$req" ]; then
264 285
		echo "Error: $LIBDIR/$req not found"
265 286
		exit 1;
266 287
	fi
......
270 291
	for req in $NONMACLIB
271 292
	do
272 293
		echo "	Checking $req"
273
		if [ ! -f "$LIBDIR/$req" ]; then
294
		if [[ $PLAT = "FreeBSD"* ]]; then
295
			command=`ldconfig -r | grep $req 2>/dev/null`
296
			RC=$?
297
			if [ $RC -ne 0 ]; then
298
				echo "Error: $req not found"
299
				exit 1;
300
			fi
301
		elif [ ! -f "$LIBDIR/$req" ]; then
274 302
			echo "Error: $LIBDIR/$req not found"
275 303
			exit 1;
276 304
		fi
......
281 309
for req in $HEADERREQ
282 310
do
283 311
	echo "	Checking $req"
284
	if [ ! -f "/usr/include/$req" ]; then
285
		echo "Error: /usr/include/$req not found"
312
	if [ ! -f "/usr/include/$req" -a ! -f "/usr/local/include/$req" ]; then
313
		echo "Error: /usr/(local/)include/$req not found"
286 314
		exit 1;
287 315
	fi
288 316
done
......
291 319
	for req in $NONMACHEADER
292 320
	do
293 321
		echo "	Checking $req"
294
		if [ ! -f "/usr/include/$req" ]; then
295
			echo "Error: /usr/include/$req not found"
322
		if [ ! -f "/usr/include/$req" -a ! -f "/usr/local/include/$req" ]; then
323
			echo "Error: /usr/(local/)include/$req not found"
296 324
			exit 1;
297 325
		fi
298 326
	done
......
301 329
if [ x"$ZIMBRA" = x"no" ]; then
302 330
	echo "Cleaning contents of /opt/zimbra"
303 331
	if [ -d "/opt/zimbra" ]; then
304
		rm -rf /opt/zimbra/* 2>/dev/null
305
		rm -rf /opt/zimbra/.* 2>/dev/null
332
		if [ x$TEST != x"yes" ]; then
333
			rm -rf /opt/zimbra/* 2>/dev/null
334
			rm -rf /opt/zimbra/.* 2>/dev/null
335
		fi
306 336
		mkdir -p /opt/zimbra
307 337
	fi
308 338
else
......
331 361

  
332 362
cd ${PATHDIR}
333 363
rm -f make.out 2> /dev/null
334
make allclean > /dev/null 2>&1
364
$MAKE allclean > /dev/null 2>&1
335 365

  
336 366
if [ x$PUBLIC = x"yes" ]; then
337
	make all CMIRROR=$MIRROR BETA=$BETA 2>&1 | tee -a make.out
367
	$MAKE all CMIRROR=$MIRROR BETA=$BETA 2>&1 | tee -a make.out
338 368
else
339
	make all 2>&1 | tee -a make.out
369
	$MAKE all 2>&1 | tee -a make.out
340 370
fi
341 371

  
342 372
mkdir -p $PATHDIR/../logs
IRONMAIDEN-808.fbsd/ThirdParty/clamav/Makefile 2014-04-09 14:58:38.000000000 +0200
11 11

  
12 12
ZIMBRA_HOME ?= /opt/zimbra
13 13

  
14
PATCH	:= patch -N -g0 -p1 < ../patches/fix-configure-98.patch
14
CLAMAV_PATCH	:= $(PATCH_BINARY) -N -g0 -p1 < ../patches/fix-configure-98.patch
15 15
CONFIG_OPT	:=
16 16
CPPFLAGS 	:=
17 17
LDFLAGS		:=
......
43 43
build:
44 44
	(tar xzf src/clamav-$(CLAMAV_VERSION).tar.gz; \
45 45
	cd clamav-$(CLAMAV_VERSION); \
46
	$(PATCH); \
46
	$(CLAMAV_PATCH); \
47 47
	CFLAGS="-g -O2" \
48 48
	$(CPPFLAGS) \
49 49
	$(LDFLAGS) \
IRONMAIDEN-808.fbsd/ThirdParty/curl/Makefile 2014-04-09 16:09:41.000000000 +0200
10 10

  
11 11
ifdef BETA
12 12
	include $(CURL_ROOT)/../beta_versions.def
13
	PATCH	:= patch -N -g0 -p1 < ../patches/krb5-7200.patch;
13
	CURL_PATCH	:= $(PATCH_BINARY) -N -g0 -p1 < ../patches/krb5-7200.patch;
14 14
else
15 15
	include $(CURL_ROOT)/../versions.def
16
	PATCH	:= patch -N -g0 -p1 < ../patches/krb5-7200.patch;
16
	CURL_PATCH	:= $(PATCH_BINARY) -N -g0 -p1 < ../patches/krb5-7200.patch;
17
endif
18

  
19
ifeq (FreeBSD_amd64,$(BUILD_PLATFORM))
20
        CURL_PATCH += $(PATCH_BINARY) -N -g0 -p1 < ../patches/FreeBSD-netinet.patch;
17 21
endif
18 22

  
19 23

  
......
53 57
	tar xzf src/curl-$(CURL_VERSION).tar.gz
54 58
	(cd curl-$(CURL_VERSION); \
55 59
	$(SED) -i -e 's|https://mxr.mozilla.org|http://mxr.mozilla.org|' lib/mk-ca-bundle.pl; \
56
	$(PATCH) \
60
	$(CURL_PATCH) \
57 61
	./buildconf; \
58 62
	DYLD_LIBRARY_PATH=$(OPENSSL_LIB_DIR):$(HEIMDAL_LIB_DIR):$(CURL_LIB_DIR) \
59 63
	LD_RUN_PATH=$(OPENSSL_LIB_DIR):$(HEIMDAL_LIB_DIR):$(CURL_LIB_DIR) \
......
61 65
	CFLAGS="-g -O2" \
62 66
	./configure --prefix=$(ZIMBRA_HOME)/curl-$(CURL_VERSION) --disable-ldap --disable-ldaps \
63 67
		--with-gssapi=/opt/zimbra/heimdal-$(HEIMDAL_VERSION) \
64
		--with-ssl=/opt/zimbra/openssl-$(OPENSSL_VERSION) \
68
		--with-ssl=$(OPENSSL_DIR) \
65 69
		--without-gnutls \
66 70
		--with-ca-bundle=/opt/zimbra/curl-$(CURL_VERSION)/share/curl/ca-bundle.crt \
67 71
		--enable-ipv6 \
IRONMAIDEN-808.fbsd/ThirdParty/curl/patches/FreeBSD-netinet.patch 2014-04-09 16:08:10.000000000 +0200
1
diff -uNr curl-7.36.0/lib/hostcheck.c curl-7.36.0.fbsd/lib/hostcheck.c
2
--- curl-7.36.0/lib/hostcheck.c	2014-03-25 23:01:37.000000000 +0100
3
+++ curl-7.36.0.fbsd/lib/hostcheck.c	2014-04-09 16:07:16.000000000 +0200
4
@@ -30,6 +30,12 @@
5
 #include "rawstr.h"
6
 #include "inet_pton.h"
7
 
8
+#ifdef ENABLE_IPV6
9
+#ifdef HAVE_NETINET_IN_H
10
+#include <netinet/in.h>
11
+#endif
12
+#endif
13
+
14
 #include "curl_memory.h"
15
 /* The last #include file should be: */
16
 #include "memdebug.h"
IRONMAIDEN-808.fbsd/ThirdParty/cyrus-sasl/Makefile 2014-04-09 14:28:32.000000000 +0200
32 32
check:
33 33
	@echo "Verifying cyrus-sasl build...";
34 34
	$(CYRUS_ROOT)/../zmcheck.pl -s $(ZIMBRA_HOME)/cyrus-sasl-$(CYRUS_VERSION)/sbin/saslauthd
35
	$(CYRUS_ROOT)/../zmcheck.pl -l $(ZIMBRA_HOME)/cyrus-sasl-$(CYRUS_VERSION)/lib/sasl2/libgssapiv2.so.3.0.0
35
	$(CYRUS_ROOT)/../zmcheck.pl -l $(ZIMBRA_HOME)/cyrus-sasl-$(CYRUS_VERSION)/lib/sasl2/libgssapiv2.so
36 36

  
37 37
build:
38 38
	@echo "Building cyrus-sasl for $(BUILD_PLATFORM)"
......
40 40
	(tar xfz src/cyrus-sasl-$(CYRUS_RELEASE).tar.gz; \
41 41
	mv cyrus-sasl-$(CYRUS_RELEASE) cyrus-sasl-$(CYRUS_VERSION); \
42 42
	cd cyrus-sasl-$(CYRUS_VERSION); \
43
	patch -g0 -p1 < ../patches/sasl-auth-zimbra-2.1.25.patch; \
44
	patch -g0 -p1 < ../patches/saslauthd-conf.patch; \
45
	patch -g0 -p1 < ../patches/auxprop.patch; \
43
	$(PATCH_BINARY) -g0 -p1 < ../patches/sasl-auth-zimbra-2.1.25.patch; \
44
	$(PATCH_BINARY) -g0 -p1 < ../patches/saslauthd-conf.patch; \
45
	$(PATCH_BINARY) -g0 -p1 < ../patches/auxprop.patch; \
46 46
	$(PATCH))
47 47
	_S_='~' ./zimbra-cyrus-sasl-build.sh ${BSTR}
48 48
	(cd cyrus-sasl-$(CYRUS_VERSION); $(MAKE) install)
IRONMAIDEN-808.fbsd/ThirdParty/cyrus-sasl/patches/sasl-auth-zimbra-2.1.25.patch 2014-04-09 14:28:32.000000000 +0200
329 329
diff -Naur cyrus-sasl-2.1.22/saslauthd/zmauth.c cyrus-sasl-2.1.22-zimbra/saslauthd/zmauth.c
330 330
--- cyrus-sasl-2.1.22/saslauthd/zmauth.c	1970-01-01 05:30:00.000000000 +0530
331 331
+++ cyrus-sasl-2.1.22-zimbra/saslauthd/zmauth.c	2007-09-10 23:01:49.000000000 +0530
332
@@ -0,0 +1,348 @@
332
@@ -0,0 +1,350 @@
333 333
+/*
334 334
+ * Do an auth (SOAP) request against a zimbra server.
335 335
+ */
336 336
+#include <string.h>
337 337
+#include <stdlib.h>
338 338
+#include <stdarg.h>
339
+#ifdef DARWIN
339
+#if defined(DARWIN)
340 340
+#include <malloc/malloc.h>
341
+#elif defined(FREEBSD)
342
+#include <stdlib.h>
341 343
+#else
342 344
+#include <malloc.h>
343 345
+#endif
IRONMAIDEN-808.fbsd/ThirdParty/cyrus-sasl/zimbra-cyrus-sasl-build.sh 2014-04-09 14:28:32.000000000 +0200
9 9
BETA=$1
10 10

  
11 11
platform=`uname -s`
12
patch=patch
13
make=make
12 14
cyrus_root=`pwd`
13 15
p4_root=`cd ${cyrus_root}/../..; pwd`
14 16
build_platform=`sh ${p4_root}/ZimbraBuild/rpmconf/Build/get_plat_tag.sh`
......
23 25
rm config/ltconfig config/libtool.m4
24 26
if [ -x /usr/bin/libtoolize ]; then
25 27
	LIBTOOLIZE=/usr/bin/libtoolize
28
elif [ -x /usr/local/bin/libtoolize ]; then
29
	LIBTOOLIZE=/usr/local/bin/libtoolize
26 30
else
27 31
	if [ -x /opt/local/bin/glibtoolize ]; then
28 32
		export CPPFLAGS=-DDARWIN
......
96 100
elif [ $build_platform = "F7" -o $build_platform -o "DEBIAN4.0" ]; then
97 101
     sed -i.bak -e 's/\_la_LDFLAGS)/_la_LDFLAGS) $(AM_LDFLAGS)/' plugins/Makefile
98 102
fi
99
LD_RUN_PATH="${openssl_lib_dir}:${heimdal_lib_dir}:${cyrus_lib_dir}:${curl_lib_dir}" make
103
LD_RUN_PATH="${openssl_lib_dir}:${heimdal_lib_dir}:${cyrus_lib_dir}:${curl_lib_dir}" $make
IRONMAIDEN-808.fbsd/ThirdParty/heimdal/Makefile 2014-04-09 14:28:32.000000000 +0200
18 18
endif
19 19

  
20 20
LIBEXT	:= so
21
PATCH	:=
21
HEIMDAL_PATCH	:=
22 22
ifeq (MACOSXx86,$(findstring MACOSXx86,$(BUILD_PLATFORM)))
23
	PATCH   := patch -g0 -N -p1 < ../patches/mac.patch;
23
	HEIMDAL_PATCH   := $(PATCH_BINARY) -g0 -N -p1 < ../patches/mac.patch;
24 24
	LIBEXT	:= dylib
25 25
endif
26 26

  
27
CFLAGS	:= -g -O2 -D_REENTRANT
28
ifeq (FreeBSD, $(findstring FreeBSD, $(BUILD_PLATFORM)))
29
	CFLAGS += -pthread
30
endif
31

  
27 32
HEIMDAL_TGZ_TARGET := $(P4_ROOT)/ThirdPartyBuilds/$(BUILD_PLATFORM)/heimdal/heimdal-$(HEIMDAL_VERSION).tgz
28 33
HEIMDAL_SOURCE := $(HEIMDAL_ROOT)/heimdal-$(HEIMDAL_VERSION)
29 34

  
......
48 53
build:
49 54
	(tar xzf src/heimdal-$(HEIMDAL_VERSION).tar.gz; \
50 55
	cd heimdal-$(HEIMDAL_VERSION); \
51
	$(PATCH) \
52
	CFLAGS="-g -O2 -D_REENTRANT" \
53
	CCFLAGS="-g -O2 -D_REENTRANT" \
56
	$(HEIMDAL_PATCH) \
57
	CFLAGS="$(CFLAGS)" \
58
	CCFLAGS="$(CFLAGS)" \
54 59
	COMPILE_ET="NO" \
55 60
	$(LDFLAGS) \
56
	CPPFLAGS="-I$(ZIMBRA_HOME)/openssl-$(OPENSSL_VERSION)/include" \
61
	CPPFLAGS="-I$(OPENSSL_INCLUDE_DIR)" \
57 62
	./configure --prefix=$(ZIMBRA_HOME)/heimdal-$(HEIMDAL_VERSION) \
58
	CCFLAGS="-g -O2 -D_REENTRANT" \
63
	CCFLAGS="$(CFLAGS)" \
59 64
	--sysconfdir=/etc \
60 65
	--enable-shared \
61 66
	--enable-pthread-support \
62
	--with-openssl=$(ZIMBRA_HOME)/openssl-$(OPENSSL_VERSION) \
67
	--with-openssl=$(OPENSSL_DIR) \
63 68
	--disable-berkeley-db \
64 69
	--disable-ndbm-db \
65 70
	--disable-afs-support \
IRONMAIDEN-808.fbsd/ThirdParty/libxml2/Makefile 2014-04-09 14:28:32.000000000 +0200
18 18
XML_CONFIGURE ?= --prefix=$(INSTALL_PREFIX) --enable-shared=no --enable-static=yes --without-python
19 19
LDFLAGS	:= LDFLAGS="-Wl,-rpath,$(INSTALL_PREFIX)/lib"
20 20

  
21
XML_PATCH := $(PATCH_BINARY) -p1 < ../patches/libxml2-security.patch;
22

  
21 23
ifeq ($(BUILD_PLATFORM), )
22 24
	BUILD_PLATFORM := "UNKNOWN"
23 25
endif
......
33 35
	(tar xzf src/$(XML_NAME)-$(XML_VERSION).tar.gz; \
34 36
	mv $(XML_NAME)-$(XML_VERSION) $(XML_NAME)-$(XML_VERSION); \
35 37
	cd $(XML_NAME)-$(XML_VERSION); \
36
	patch -p1 < ../patches/libxml2-security.patch; \
38
	$(XML_PATCH) \
37 39
	$(LDFLAGS) \
38 40
	CFLAGS="-g -O2 -fPIC" \
39 41
	./configure $(XML_CONFIGURE); $(MAKE) $(MAKEARGS); $(MAKE) install)
IRONMAIDEN-808.fbsd/ThirdParty/memcached/Makefile 2014-04-09 14:57:15.000000000 +0200
1 1
MEMCACHED_ROOT := $(shell pwd)
2 2
P4_ROOT ?= $(shell cd $(MEMCACHED_ROOT)/../..; pwd)
3
MAKE ?= make
4
MAKEARGS ?= -j2
3 5

  
4 6
BUILD_PLATFORM ?= $(shell sh $(P4_ROOT)/ZimbraBuild/rpmconf/Build/get_plat_tag.sh)
5 7

  
......
9 11

  
10 12
ZIMBRA_HOME ?= /opt/zimbra
11 13

  
12
PATCH	:=
14
MEMCACHED_PATCH	:=
13 15

  
14 16
ifdef BETA
15 17
	include $(MEMCACHED_ROOT)/../beta_versions.def
......
35 37
	(tar xfz src/libevent-$(LIBEVENT_VERSION).tar.gz; \
36 38
	cd libevent-$(LIBEVENT_VERSION); \
37 39
	CFLAGS="-g -O2" ./configure --prefix=$(ZIMBRA_HOME)/memcached-$(MEMCACHED_VERSION); \
38
	make; make install; \
40
	$(MAKE); $(MAKE) install; \
39 41
	cd $(MEMCACHED_ROOT); \
40 42
	tar xzf src/memcached-$(MEMCACHED_VERSION).tar.gz; \
41 43
	cd memcached-$(MEMCACHED_VERSION); \
42
	$(PATCH) \
44
	$(MEMCACHED_PATCH) \
43 45
	CFLAGS="-g -O2" ./configure --prefix=$(ZIMBRA_HOME)/memcached-$(MEMCACHED_VERSION) \
44 46
	--with-libevent=$(ZIMBRA_HOME)/memcached-$(MEMCACHED_VERSION); \
45
	LD_RUN_PATH=/opt/zimbra/memcached/lib make; make install)
47
	LD_RUN_PATH=/opt/zimbra/memcached/lib $(MAKE); $(MAKE) install)
46 48
	(cd $(ZIMBRA_HOME); ln -s memcached-$(MEMCACHED_VERSION) memcached)
47 49

  
48 50
tar:
IRONMAIDEN-808.fbsd/ThirdParty/mysql/Makefile 2014-04-09 14:55:29.000000000 +0200
5 5

  
6 6
MAKE ?= make
7 7
MAKEARGS ?= -j2
8
CMAKE ?= cmake
8 9

  
9 10
ifeq ($(BUILD_PLATFORM), )
10 11
	BUILD_PLATFORM := "UNKNOWN"
......
14 15

  
15 16
ifdef BETA
16 17
	include $(MYSQL_ROOT)/../beta_versions.def
17
	PATCH   := patch -g0 -N -p1 < ../patches/openssl.patch; patch -g0 -N -p1 < ../patches/apple-runpath.patch;
18
	MYSQL_PATCH   := $(PATCH_BINARY) -g0 -N -p1 < ../patches/openssl.patch; $(PATCH_BINARY) -g0 -N -p1 < ../patches/apple-runpath.patch;
18 19
else
19 20
	include $(MYSQL_ROOT)/../versions.def
20
	PATCH   := patch -g0 -N -p1 < ../patches/openssl.patch; patch -g0 -N -p1 < ../patches/apple-runpath.patch;
21
	MYSQL_PATCH   := $(PATCH_BINARY) -g0 -N -p1 < ../patches/openssl.patch; $(PATCH_BINARY) -g0 -N -p1 < ../patches/apple-runpath.patch;
21 22
endif
22 23

  
23 24
MYSQL_VERSION ?= $(MYSQL_VERSION_STRING)
......
54 55
	rm -rf mysql-$(MYSQL_VERSION_STRING)
55 56
	tar xzf src/mysql-$(MYSQL_VERSION_STRING).tar.gz
56 57
	(cd mysql-$(MYSQL_VERSION_STRING); \
57
	$(PATCH) \
58
	$(MYSQL_PATCH) \
58 59
	CFLAGS="-O3 -fno-omit-frame-pointer -g -pipe -Wall -Wno-uninitialized -DNDEBUG" \
59 60
	CXXFLAGS="-O3 -fno-omit-frame-pointer -g -pipe -Wall -Wno-uninitialized -DNDEBUG" \
60 61
	$(LDFLAGS) \
61
	CPPFLAGS="-I/opt/zimbra/openssl-$(OPENSSL_VERSION)/include" \
62
	/usr/bin/cmake . -DCMAKE_SKIP_BUILD_RPATH=FALSE \
62
	CPPFLAGS="-I$(OPENSSL_INCLUDE_DIR)" \
63
	$(CMAKE) . -DCMAKE_SKIP_BUILD_RPATH=FALSE \
63 64
	-DCMAKE_BUILD_WITH_INSTALL_RPATH=FALSE \
64
	-DCMAKE_INSTALL_RPATH="/opt/zimbra/openssl-$(OPENSSL_VERSION)/lib" \
65
	-DCMAKE_PREFIX_PATH=/opt/zimbra/openssl-$(OPENSSL_VERSION) -DWITH_SSL=system \
65
	-DCMAKE_INSTALL_RPATH="$(OPENSSL_LIB_DIR)" \
66
	-DCMAKE_PREFIX_PATH=$(OPENSSL_DIR) -DWITH_SSL=system \
66 67
	-DCMAKE_INSTALL_PREFIX=/opt/zimbra/mysql-$(MYSQL_VERSION) \
67 68
	-DCOMPILATION_COMMENT="Zimbra binary distribution" \
68 69
	-DBUILD_CONFIG=mysql_release; \
IRONMAIDEN-808.fbsd/ThirdParty/nginx/Makefile 2014-04-09 15:06:13.000000000 +0200
1 1
NGINX_ROOT := $(shell pwd)
2 2
P4_ROOT ?= $(shell cd $(NGINX_ROOT)/../..; pwd)
3
MAKE ?= make
4
MAKEARGS ?= -j2
3 5

  
4 6
BUILD_PLATFORM ?= $(shell sh $(P4_ROOT)/ZimbraBuild/rpmconf/Build/get_plat_tag.sh)
5 7

  
......
68 70
	    --add-module=$(KEEPALIVE_SOURCE) \
69 71
            --add-module=$(CHUNKIN_SOURCE);)
70 72
	(cd nginx-$(NGINX_VERSION)-zimbra; \
71
	LD_RUN_PATH="$(CYRUS_LIB_DIR):$(OPENSSL_LIB_DIR)" make; make install)
73
	LD_RUN_PATH="$(CYRUS_LIB_DIR):$(OPENSSL_LIB_DIR)" $(MAKE); $(MAKE) install)
72 74
	(cd $(ZIMBRA_HOME); ln -s nginx-$(NGINX_VERSION)-zimbra nginx)
73 75

  
74 76
tar:
......
81 83
	
82 84

  
83 85
clean:
84
	-make -C nginx-$(NGINX_VERSION)-zimbra clean
86
	-$(MAKE) -C nginx-$(NGINX_VERSION)-zimbra clean
85 87

  
86 88
allclean: clean
87 89
	/bin/rm -rf $(ZIMBRA_HOME)/nginx-$(NGINX_VERSION)-zimbra
......
94 96
	tar zxf $(CHUNKIN_TGZ_SRC)
95 97
	tar zxf $(KEEPALIVE_TGZ_SRC)
96 98
	(cd $(KEEPALIVE_SOURCE); \
97
	patch -g0 -N -p1 < ../patches/osx-keepalive.patch;)
99
	$(PATCH_BINARY) -g0 -N -p1 < ../patches/osx-keepalive.patch;)
IRONMAIDEN-808.fbsd/ThirdParty/openldap/Makefile 2014-04-09 14:28:32.000000000 +0200
32 32
		 -Wl,-rpath,$(OPENSSL_LIB_DIR) -Wl,-rpath,$(CYRUS_LIB_DIR) -Wl,-rpath,$(LDAP_LIB_DIR) -Wl,-rpath,$(LIBTOOL_LIB_DIR)"
33 33
endif
34 34

  
35
ifeq (FreeBSD,$(findstring FreeBSD,$(BUILD_PLATFORM)))
36
 	LDAP_CONFIG_FLAG := --without-fetch
37
 	# XXX FreeBSD does not implement O_DSYNC and fdatasync at this time.
38
 	CPPFLAG+= -DMDB_DSYNC=O_SYNC -Dfdatasync=fsync
39
endif
40

  
35 41
LDAP_TGZ_TARGET := $(P4_ROOT)/ThirdPartyBuilds/$(BUILD_PLATFORM)/openldap/openldap-$(LDAP_VERSION).tgz
36 42
LDAP_LIB_TGZ_TARGET := $(P4_ROOT)/ThirdPartyBuilds/$(BUILD_PLATFORM)/openldap/openldap-libs-$(LDAP_VERSION).tgz
37 43

  
......
46 52
	(tar xzf src/openldap-$(LDAP_RELEASE).tgz; \
47 53
	mv openldap-$(LDAP_RELEASE) openldap-$(LDAP_VERSION); \
48 54
	cd openldap-$(LDAP_VERSION); \
49
	patch -g0 -N -p1 < ../patches/ITS5037.patch; \
50
	$(PATCH) \
51
	patch -g0 -N -p1 < ../patches/leopard.fix; \
55
	$(LDAP_PATCH) \
52 56
	$(LDFLAGS) \
53 57
	LD_LIBRARY_PATH=$(OPENSSL_LIB_DIR):$(CYRUS_LIB_DIR):$(LIBTOOL_LIB_DIR) \
54 58
	CPPFLAGS="-I$(ZIMBRA_HOME)/cyrus-sasl-$(CYRUS_VERSION)/include \
55
		  -I$(ZIMBRA_HOME)/openssl-$(OPENSSL_VERSION)/include -I$(ZIMBRA_HOME)/libtool-$(LIBTOOL_VERSION)/include $(CPPFLAG)" \
56
	CFLAGS="-g -O0" \
59
		  -I$(OPENSSL_INCLUDE_DIR) -I$(ZIMBRA_HOME)/libtool-$(LIBTOOL_VERSION)/include $(CPPFLAG)" \
60
	CFLAGS="-g -O0 $(CPPFLAG)" \
57 61
	$(ENVMOD) ./configure --prefix=$(ZIMBRA_HOME)/openldap-$(LDAP_VERSION) --libexecdir=$(ZIMBRA_HOME)/openldap-$(LDAP_VERSION)/sbin \
58 62
	--with-cyrus-sasl \
59 63
	--with-tls=openssl \
......
69 73
	--enable-overlays=mod \
70 74
	--enable-debug \
71 75
	--enable-spasswd \
76
	$(LDAP_CONFIG_FLAG) \
72 77
	--enable-crypt; \
73 78
	LD_RUN_PATH=$(OPENSSL_LIB_DIR):$(CYRUS_LIB_DIR):$(LIBTOOL_LIB_DIR) $(MAKE) depend; \
74 79
	LD_RUN_PATH=$(OPENSSL_LIB_DIR):$(CYRUS_LIB_DIR):$(LIBTOOL_LIB_DIR) $(MAKE) $(MAKEARGS); \
75 80
	LD_RUN_PATH=$(OPENSSL_LIB_DIR):$(CYRUS_LIB_DIR):$(LIBTOOL_LIB_DIR) $(MAKE) install STRIP="")
76
	(cd openldap-$(LDAP_VERSION)/libraries/liblmdb; make; \
81
	(cd openldap-$(LDAP_VERSION)/libraries/liblmdb; \
82
	XCFLAGS="$(CPPFLAG)" $(MAKE); \
77 83
	cp mdb_stat $(ZIMBRA_HOME)/openldap-$(LDAP_VERSION)/bin; \
78 84
	cp mdb_stat.1 $(ZIMBRA_HOME)/openldap-$(LDAP_VERSION)/share/man/man1; \
79 85
	cp mdb_copy $(ZIMBRA_HOME)/openldap-$(LDAP_VERSION)/bin; \
IRONMAIDEN-808.fbsd/ThirdParty/openssl/Makefile 2014-04-09 14:50:53.000000000 +0200
41 41
	PLAT := linux-elf
42 42
endif
43 43

  
44
ifeq (FreeBSD_amd64,$(BUILD_PLATFORM))
45
	PLAT := BSD-x86_64
46
endif
47

  
44 48
OPENSSL_TGZ_TARGET := $(P4_ROOT)/ThirdPartyBuilds/$(BUILD_PLATFORM)/openssl/openssl-$(OPENSSL_VERSION).tgz
45 49
OPENSSL_SOURCE := $(OPENSSL_ROOT)/openssl-$(OPENSSL_VERSION)
46 50

  
......
54 58
build:
55 59
	(tar xzf src/openssl-$(OPENSSL_VERSION).tar.gz; \
56 60
	cd openssl-$(OPENSSL_VERSION); \
57
	patch -p1 -N -g0 < ../patches/ipv6.patch; \
58
	patch -p1 -N -g0 < ../patches/101f-pr3232.patch; \
59 61
	CFLAGS="-g -O2 -DOPENSSL_NO_HEARTBEATS" \
60 62
	CXXFLAGS="-g -O2 -DOPENSSL_NO_HEARTBEATS" \
61 63
	PERL=/usr/bin/perl \
IRONMAIDEN-808.fbsd/ThirdParty/php/Makefile 2014-04-09 14:28:32.000000000 +0200
14 14
PATCH	:=
15 15
ifdef BETA
16 16
	include $(PHP_ROOT)/../beta_versions.def
17
	PATCH	:= 
17
	PHP_PATCH	:= 
18 18
else
19 19
	include $(PHP_ROOT)/../versions.def
20
	PATCH	:= 
20
	PHP_PATCH	:= 
21 21
endif
22 22

  
23
SED := sed -i .bak -e 's/-lxml2/\/opt\/zimbra\/libxml2-$(XML_VERSION)\/lib\/libxml2.a/g' Makefile
23
PHP_PATCH_SED := sed -i .bak -e 's/-lxml2/\/opt\/zimbra\/libxml2-$(XML_VERSION)\/lib\/libxml2.a/g' Makefile;
24 24

  
25 25
PHP_TGZ_TARGET := \
26 26
	$(P4_ROOT)/ThirdPartyBuilds/$(BUILD_PLATFORM)/php/php-$(PHP_VERSION).tgz
......
35 35
build:
36 36
	tar xfj src/php-$(PHP_VERSION).tar.bz2
37 37
	(cd php-$(PHP_VERSION); \
38
	$(PATCH) $(ACEXE) CFLAGS="-g -O2" \
38
	$(PHP_PATCH) \
39
	$(ACEXE) CFLAGS="-g -O2" \
39 40
	./configure --prefix=/opt/zimbra/php-$(PHP_VERSION) --with-apxs2=/opt/zimbra/httpd-$(HTTPD_VERSION)/bin/apxs --with-config-file-path=/opt/zimbra/conf --with-pspell=/opt/zimbra/aspell-$(ASPELL_VERSION) --with-libxml-dir=/opt/zimbra/libxml2-$(XML_VERSION); \
40
	$(SED); \
41
	$(PHP_PATCH_SED) \
41 42
	$(MAKE) $(MAKEARGS); \
42 43
	$(MAKE) install)
43 44

  
IRONMAIDEN-808.fbsd/ThirdParty/postfix/Makefile 2014-04-09 14:49:37.000000000 +0200
9 9

  
10 10
ZIMBRA_HOME ?= /opt/zimbra
11 11

  
12
PATCH	:= patch -g0 -p1 < ../patches/tw.patch;
12
POSTFIX_PATCH	:=	$(PATCH_BINARY) -g0 -p1 < ../patches/tw.patch; \
13
			$(PATCH_BINARY) -g0 -p1 < ../patches/postfix-main-cf-zimbra.patch; \
14
			$(PATCH_BINARY) -g0 -p1 < ../patches/stop-warning.patch;
15

  
13 16
ifdef BETA
14 17
	include $(POSTFIX_ROOT)/../beta_versions.def
15 18
else
......
20 23
DBLIB := -L/opt/zimbra/bdb-$(BDB_VERSION)/lib -ldb
21 24
POSTFIX_TGZ_TARGET := \
22 25
	$(P4_ROOT)/ThirdPartyBuilds/$(BUILD_PLATFORM)/postfix/postfix-$(POSTFIX_VERSION).tgz
23
BDB_PATCH	:= patch -g0 -p1 < ../patches/postfix-zimbra-bdb.patch;
26
POSTFIX_BDB_PATCH := $(PATCH_BINARY) -g0 -p1 < ../patches/postfix-zimbra-bdb.patch;
24 27

  
25
PCRE_DEF := -DHAS_PCRE
26
PCRE_INCLUDE := -I/usr/include/pcre
27
PCRE_LIB := -lpcre
28
PCRE_DEF ?= -DHAS_PCRE
29
PCRE_INCLUDE ?= -I/usr/include/pcre
30
PCRE_LIB ?= -lpcre
28 31

  
29 32
MYSQL_VERSION ?= $(MYSQL_VERSION_STRING)
30 33
MYSQL_CLIENT_VERSION ?= $(MYSQL_VERSION_STRING)-clientlibs
31 34

  
32
SYSTEM_LIB := /usr/lib
35
SYSTEM_LIB ?= /usr/lib
33 36

  
34 37
LD_RUN_PATH := /opt/zimbra/lib:/opt/zimbra/mysql-$(MYSQL_VERSION)/lib:/opt/zimbra/openldap-$(LDAP_VERSION)/lib:/opt/zimbra/openssl-$(OPENSSL_VERSION)/lib:/opt/zimbra/cyrus-sasl-$(CYRUS_VERSION)/lib:/opt/zimbra/bdb-$(BDB_VERSION)/lib
35 38
MYSQL_INC := /opt/zimbra/mysql-$(MYSQL_VERSION)/include
36 39
MYSQL_LIB := /opt/zimbra/mysql-$(MYSQL_VERSION)/lib
37 40

  
41
ifeq (FreeBSD,$(findstring FreeBSD,$(BUILD_PLATFORM)))
42
	CFLAGS += -pthread
43
endif
38 44

  
39 45
INSTALL_PARMS := install_root=/../
40 46

  
......
49 55
	tar xzf src/postfix-$(POSTFIX_RELEASE).tar.gz
50 56
	(mv postfix-$(POSTFIX_RELEASE) postfix-$(POSTFIX_VERSION); \
51 57
	cd postfix-$(POSTFIX_VERSION); \
52
	$(BDB_PATCH) \
53
	$(PATCH) \
54
	patch -g0 -p1 < ../patches/postfix-main-cf-zimbra.patch; \
55
	patch -g0 -p1 < ../patches/stop-warning.patch; \
58
	$(POSTFIX_BDB_PATCH) \
59
	$(POSTFIX_PATCH) \
56 60
	$(MAKE) $(MAKEARGS)  makefiles \
57
	OPT="-O2" \
61
	OPT="-O2 $(CFLAGS)" \
58 62
	DEBUG="-g" \
59 63
	CCARGS='-DDEF_COMMAND_DIR=\"/opt/zimbra/postfix-$(POSTFIX_VERSION)/sbin\" \
60 64
	-DDEF_DAEMON_DIR=\"/opt/zimbra/postfix-$(POSTFIX_VERSION)/libexec\" \
......
82 86
	-lldap -llber \
83 87
	-L$(MYSQL_LIB) \
84 88
	-L/opt/zimbra/openssl-$(OPENSSL_VERSION)/lib \
85
	-lmysqlclient -lz -lm -L$(SYSTEM_LIB) -lsasl2 -lpthread -lssl -lcrypto'; \
89
	-lmysqlclient -lz -lm -L$(SYSTEM_LIB) -L$(LIB_DIR) -L$(LOCAL_LIB_DIR) -lsasl2 -lpthread -lssl -lcrypto'; \
86 90
	LD_RUN_PATH=$(LD_RUN_PATH) $(MAKE) $(MAKEARGS);)
87 91

  
88 92
install:
IRONMAIDEN-808.fbsd/ThirdParty/rrdtool/Makefile 2014-04-09 14:28:32.000000000 +0200
16 16
FREETYPE_NAME	:= freetype
17 17
LIBART_NAME	:= libart_lgpl
18 18
RRDTOOL_NAME	:= rrdtool
19
RRDTOOL_PATCH	:=
19 20

  
20 21
RRDTOOL_TGZ_TARGET := $(P4_ROOT)/ThirdPartyBuilds/$(BUILD_PLATFORM)/rrdtool/$(RRDTOOL_NAME)-$(RRDTOOL_VERSION).tar.gz
21 22
INSTALL_PREFIX := $(ZIMBRA_HOME)/zimbramon/$(RRDTOOL_NAME)-$(RRDTOOL_VERSION)
......
78 79
build:
79 80
	(tar $(pngtar) $(pngsrc); \
80 81
	cd $(PNG_NAME)-$(PNG_VERSION); \
82
	$(RRDTOOL_PATCH) \
81 83
	env CFLAGS="-g -O2 -fPIC" ./configure \
82 84
		--prefix=$(INSTALL_PREFIX) \
83 85
		--mandir=$(INSTALL_PREFIX)/man \
......
103 105
	tar $(rrdtooltar) $(rrdtoolsrc); \
104 106
	rm -rf $(PERL_DIR)/lib; \
105 107
	cd $(RRDTOOL_NAME)-$(RRDTOOL_VERSION); \
108
	$(FREEBSD_RRDTOOL_PATCH) \
106 109
	$(ENVMOD) ./configure --prefix=$(INSTALL_PREFIX) \
107 110
		--enable-static --enable-shared=no \
108 111
		--with-perl-options="PREFIX=$(PERL_DIR) LIB=$(PERL_LIB_DIR) LIBS='-L$(INSTALL_PREFIX)/lib -lm -lpng -lz -lfreetype'" \
IRONMAIDEN-808.fbsd/ThirdParty/rrdtool/patches/rrdtool-1.2.30-FreeBSD.patch 2014-04-09 14:28:32.000000000 +0200
1
--- rrdtool-1.2.30/bindings/perl-shared/Makefile.PL.orig	2013-05-05 14:33:11.000000000 +0200
2
+++ rrdtool-1.2.30/bindings/perl-shared/Makefile.PL	2013-05-05 14:33:22.000000000 +0200
3
@@ -35,6 +35,8 @@
4
     #'dynamic_lib'  => {'OTHERLDFLAGS' => "$librrd -lm"},
5
     'depend'       => {'RRDs.c' => "../../src/librrd.la"},
6
     'LDFROM'       => '$(OBJECT) '.$librrd,        
7
-    'realclean'    => {FILES => 't/demo?.rrd t/demo?.png' }
8
+    'realclean'    => {FILES => 't/demo?.rrd t/demo?.png' },
9
+    'LDDLFLAGS'    => "-shared -fstack-protector",
10
+    'LDFLAGS'      => "-pthread -Wl,-E -fstack-protector"
11
 );
12
 
IRONMAIDEN-808.fbsd/ThirdParty/sendmail/Makefile 2014-04-09 14:28:32.000000000 +0200
9 9

  
10 10
ZIMBRA_HOME ?= /opt/zimbra
11 11

  
12
PATCH   := patch -g0 -N -p1 < ../patches/ipv6.patch;
12
SENDMAIL_PATCH   := $(PATCH_BINARY) -g0 -N -p1 < ../patches/ipv6.patch;
13 13

  
14 14
ifdef BETA
15 15
	include $(SENDMAIL_ROOT)/../beta_versions.def
......
29 29
build:
30 30
	(tar xzf src/sendmail.$(SENDMAIL_VERSION).tar.gz; \
31 31
	cd sendmail-$(SENDMAIL_VERSION); \
32
	$(PATCH) \
32
	$(SENDMAIL_PATCH) \
33 33
	cd libmilter; \
34 34
	./Build -c; \
35 35
	cd ../obj.*/libmilter; \
IRONMAIDEN-808.fbsd/ThirdParty/snmp/Makefile 2014-04-09 14:28:32.000000000 +0200
53 53
	--with-sys-location="unknown" --with-logfile="$(ZIMBRA_HOME)/log/snmpd.log" \
54 54
	--with-openssl=$(ZIMBRA_HOME)/openssl-$(OPENSSL_VERSION) \
55 55
	--disable-embedded-perl \
56
	$(FREEBSD_SNMP_CONFIGURE_ARGS) \
56 57
	--with-perl-modules="PREFIX=$(PERL_DEST_DIR) LIB=$(PERL_DEST_LIB_DIR)" \
57 58
	--with-persistent-directory="$(INSTALL_PREFIX)/var"; \
58 59
	$(MAKE) ; $(MAKE) install)
IRONMAIDEN-808.fbsd/ThirdParty/tcmalloc/Makefile 2014-04-09 14:41:43.000000000 +0200
21 21
ifeq ($(BUILD_PLATFORM), MACOSX)
22 22
	ENVMOD := env LIBS="-lresolv" 
23 23
endif
24
CONFIG_FLAG :=
25
ifeq (FreeBSD,$(findstring FreeBSD,$(BUILD_PLATFORM)))
26
	CONFIG_FLAG := --enable-frame-pointers
27
endif
24 28

  
25 29
TCMALLOC_TGZ_TARGET := $(P4_ROOT)/ThirdPartyBuilds/$(BUILD_PLATFORM)/tcmalloc/tcmalloc-$(TCMALLOC_VERSION).tgz
26 30

  
......
37 41
	CFLAGS="-g -O2" \
38 42
	CPPFLAGS="-I/usr/include" \
39 43
	CXXFLAGS="-g -O2 -I/usr/include" \
40
	$(ENVMOD) ./configure --prefix=$(ZIMBRA_HOME)/tcmalloc-$(TCMALLOC_VERSION) --enable-minimal; \
41
	make; \
42
	make install STRIP="")
44
	$(ENVMOD) ./configure --prefix=$(ZIMBRA_HOME)/tcmalloc-$(TCMALLOC_VERSION) --enable-minimal $(CONFIG_FLAG); \
45
	$(MAKE); \
46
	$(MAKE) install STRIP="")
43 47
	(cd $(ZIMBRA_HOME); ln -s tcmalloc-$(TCMALLOC_VERSION) tcmalloc;)
44 48

  
45 49
tar:
IRONMAIDEN-808.fbsd/ThirdParty/versions.def 2014-04-09 16:32:00.000000000 +0200
7 7
ASPELL_VERSION		:= 0.60.6.1
8 8

  
9 9
BDB_VERSION		:= 5.2.36
10
BDB_LIB_DIR		:= $(ZIMBRA_HOME)/bdb-$(BDB_VERSION)/lib
10
BDB_DIR			:= $(ZIMBRA_HOME)/bdb-$(BDB_VERSION)
11
BDB_LIB_DIR		:= $(BDB_DIR)/lib
12
BDB_INCLUDE_DIR		:= $(BDB_DIR)/include
11 13

  
12 14
BSD_VERSION		:= 0.6.0
13 15

  
......
46 48
LIBMCD_VERSION		:= 1.0.6
47 49

  
48 50
LIBTOOL_VERSION		:= 2.2.6b
49
LIBTOOL_LIB_DIR		:= $(ZIMBRA_HOME)/libtool-$(LIBTOOL_VERSION)/lib
51
LIBTOOL_DIR		:= $(ZIMBRA_HOME)/libtool-$(LIBTOOL_VERSION)
52
LIBTOOL_LIB_DIR		:= $(LIBTOOL_DIR)/lib
53
LIBTOOL_INCLUDE_DIR	:= $(LIBTOOL_DIR)/include
50 54

  
51 55
MEMCACHED_VERSION	:= 1.4.17
52 56

  
......
54 58

  
55 59
NGINX_VERSION		:= 1.2.0
56 60

  
57
OPENSSL_VERSION		:= 1.0.1f
61
OPENSSL_VERSION		:= 1.0.1g
58 62
OPENSSL_LIB_DIR		:= $(ZIMBRA_HOME)/openssl-$(OPENSSL_VERSION)/lib
59 63

  
60 64
PHP_VERSION		:= 5.4.17
......
78 82
TCMALLOC_VERSION	:= 2.1
79 83

  
80 84
XML_VERSION		:= 2.7.8
85
XML_DIR			:= $(ZIMBRA_HOME)/libxml2-$(XML_VERSION)
81 86

  
82
ZMQ_VERSION		:= 3.2.3
87
### overriden later by FreeBSD
88
PATCH_BINARY		:= $(shell which patch)
89
AWK			:= $(shell which awk)
90
SYSCTL			:= $(shell which sysctl)
91
SED			:= $(shell which sed)
92

  
93
LOCAL_LIB_DIR		:= /usr/lib
94
LIB_DIR			:= /usr/lib
95
SYSTEM_LIB_DIR		:= /usr/lib
96

  
97
OPENSSL_DIR ?= $(ZIMBRA_HOME)/openssl-$(OPENSSL_VERSION)
98
OPENSSL_LIB_DIR ?= $(OPENSSL_DIR)/lib
99
OPENSSL_INCLUDE_DIR ?= $(OPENSSL_DIR)/include
100

  
101
### FreeBSD
102
# FreeBSD_amd64 specific
103
ifeq (FreeBSD_amd64,$(BUILD_PLATFORM))
104
	include $(P4_ROOT)/ZimbraBuild/defs/ThirdParty/FreeBSD_amd64.def
105
endif
106

  
107
ifeq (FreeBSD, $(findstring FreeBSD, $(BUILD_PLATFORM)))
108
	# FreeBSD version
109
	FREEBSD_OSVERSION := $(shell ${SYSCTL} -n kern.osreldate)
110

  
111
	# aliases
112
	BDB_INCLUDE := $(BDB_INCLUDE_DIR)
113
	SYSTEM_LIB := $(SYSTEM_LIB_DIR)
114

  
115
	# includes
116
	MYSQL_INCLUDE := $(ZIMBRA_HOME)/mysql/include/mysql
117
	LDAP_INCLUDE := $(ZIMBRA_HOME)/openldap/include
118
	SASL_INCLUDE := $(ZIMBRA_HOME)/cyrus-sasl/include
119

  
120
	## ThirdParty/rrdtool
121
	# fix dynamic linking of RRDs.so against /usr/local/lib (-lpng -lfreetype)
122
	FREEBSD_RRDTOOL_PATCH :=	$(PATCH_BINARY) -g0 -N -p1 < ../patches/rrdtool-$(RRDTOOL_VERSION)-FreeBSD.patch;
123
endif
124

  
125
ZMQ_VERSION		:= 3.2.4
IRONMAIDEN-808.fbsd/ThirdParty/versions.sh 2014-04-09 14:28:32.000000000 +0200
12 12
heimdal_lib_dir=/opt/zimbra/heimdal-${heimdal_version}/lib
13 13
cyrus_lib_dir=/opt/zimbra/cyrus-sasl-${cyrus_version}/lib
14 14
curl_lib_dir=/opt/zimbra/curl-${curl_version}/lib
15

  
16
patch=patch
17
make=make
18
cmake=cmake
19

  
20
if [[ $build_platform = "FreeBSD"* ]]; then
21
	patch=gpatch
22
	make=gmake
23
	export CPPFLAGS=-DFREEBSD
24
fi
IRONMAIDEN-808.fbsd/ZimbraAdminVersionCheck/build.xml 2014-04-09 14:28:32.000000000 +0200
83 83
            <condition property="native.os" value="Linux">
84 84
                <os name="Linux"/>
85 85
            </condition>
86
            <condition property="native.os" value="FreeBSD">
87
                <os name="FreeBSD"/>
88
            </condition>
86 89
            <condition property="native.so" value="jnilib">
87 90
                <os name="Mac OS X"/>
88 91
            </condition>
89 92
            <condition property="native.so" value="so">
90 93
                <not><os name="Mac OS X"/></not>
91 94
            </condition>
95

  
92 96
            <condition property="native.arch" value="">
93 97
                <os name="Mac OS X"/>
94 98
            </condition>
IRONMAIDEN-808.fbsd/ZimbraBuild/FreeBSD_additional_pre_patch_cleanup.sh 2014-04-10 12:48:58.000000000 +0200
1
#!/bin/bash
2
#
3
# ***** BEGIN LICENSE BLOCK *****
4
# Zimbra Collaboration Suite Server
5
# Copyright (C) 2009, 2010, 2011, 2012, 2013 Zimbra Software, LLC.
6
#
7
# The contents of this file are subject to the Zimbra Public License
8
# Version 1.4 ("License"); you may not use this file except in
9
# compliance with the License.  You may obtain a copy of the License at
10
# http://www.zimbra.com/license.
11
#
12
# Software distributed under the License is distributed on an "AS IS"
13
# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied.
14
# ***** END LICENSE BLOCK *****
15
#
16

  
17
PROGDIR=`dirname $0`
18
cd $PROGDIR/..
19

  
20
rm -f ZimbraBuild/webappbuild/admin/web.xml
21
rm -f ZimbraBuild/webappbuild/zimbra/web.xml
22
rm -rf ZimbraWebClient/WebRoot/js/ajax/3rdparty/tinymce
23
rm -rf ZimbraWebClient/WebRoot/t/resources/css
24
rm -rf ZimbraWebClient/WebRoot/t/resources/sass/.sass-cache
25
rm -f ZimbraWebClient/WebRoot/t/bootstrap.js
26
rm -f ZimbraWebClient/WebRoot/t/bootstrap.json 
27
rm -f logs/*
IRONMAIDEN-808.fbsd/ZimbraBuild/Makefile 2014-04-09 18:58:22.000000000 +0200
1 1
# Makefile for entire install tree, for RPM packages.
2
MAKE ?= make
2 3

  
3 4
.PHONY: core proxy memcached mta store ldap snmp
4 5

  
......
33 34

  
34 35
all: packages patch zcs-$(RELEASE).$(BUNDLE_EXT)
35 36

  
37
test:
38
	$(MAKE) zcs-$(RELEASE).$(BUNDLE_EXT)
39

  
40
include $(DEFS_DIR)/freebsd-packages.def
41

  
36 42
include $(DEFS_DIR)/misctargets.def
37 43

  
38 44
include $(DEFS_DIR)/releasetargets.def
IRONMAIDEN-808.fbsd/ZimbraBuild/buildZCS.sh 2014-04-09 14:28:32.000000000 +0200
20 20
BUILDTHIRDPARTY=no
21 21
BUILDTYPE=foss
22 22
PMIRROR=no
23
MAKE=make
23 24

  
24 25
usage() {
25 26
	echo ""
......
64 65

  
65 66
PLAT=`$PATHDIR/../ZimbraBuild/rpmconf/Build/get_plat_tag.sh`;
66 67

  
68
if [[ $PLAT == "FreeBSD"* ]]; then
69
	. ./rpmconf/Install/Util/utilfunc.sh    
70
	echo "We do love FreeBSD so we can ease the build process a bit."
71
	echo "We can try to fetch missing files/libraries automagically."
72
	echo "By enabling this feature You agree to any and all licenses involved."
73
	echo "Actually, we could make You agree to sell us Your house but we won't do that."
74
	askYN "Do You wish to turn autofetch feature on?" "Y"
75
	if [ $response = "yes" ]; then
76
		AUTO_FETCH_MISSING_FILES_ON_FREEBSD=yes
77
	fi
78

  
79
	MAKE=gmake
80
	chmod 0755 $PATHDIR/../ZimbraBuild/rpmconf/Spec/Scripts/FreeBSD/*
81
	chmod 0755 $PATHDIR/../ZimbraBuild/rpmconf/Install/*.install.sh
82
	if [ x$AUTO_FETCH_MISSING_FILES_ON_FREEBSD = x"yes" -a ! -f $PATHDIR/../ZimbraCommon/jars/junit-4.8.2.jar ]; then
83
		echo "Warning: missing junit library, trying to fetch from http://zimbra.imladris.sk/download/jars/junit-4.8.2.jar"
84
		mkdir -p $PATHDIR/../ZimbraCommon/jars
85
		fetch -o $PATHDIR/../ZimbraCommon/jars/junit-4.8.2.jar http://zimbra.imladris.sk/download/jars/junit-4.8.2.jar
86
		echo ""
87
	fi
88
	if [ ! -f $PATHDIR/../ZimbraCommon/jars/junit-4.8.2.jar ]; then
89
		echo ""
90
		echo "Error: can't continue without junit library"
91
		echo "Please, fix $PATHDIR/../ZimbraCommon/jars/junit-4.8.2.jar"
92
		exit 1
93
	fi
94

  
95
	if [ x$AUTO_FETCH_MISSING_FILES_ON_FREEBSD = x"yes" -a ! -f $PATHDIR/../ThirdPartyBuilds/${PLAT}/java/junixsocket/libjunixsocket-freebsd-1.5-amd64.so ]; then
96
		echo "Warning: missing libjunix native library, trying to fetch from http://zimbra.imladris.sk/download/files/libjunixsocket-freebsd-1.5-amd64.so"
97
		mkdir -p $PATHDIR/../ThirdPartyBuilds/${PLAT}/java/junixsocket
98
                fetch -o $PATHDIR/../ThirdPartyBuilds/${PLAT}/java/junixsocket/libjunixsocket-freebsd-1.5-amd64.so http://zimbra.imladris.sk/download/files/libjunixsocket-freebsd-1.5-amd64.so
99
                echo ""
100
	fi
101
	if [ ! -f $PATHDIR/../ThirdPartyBuilds/${PLAT}/java/junixsocket/libjunixsocket-freebsd-1.5-amd64.so ]; then
102
		echo ""
103
		echo "Error: can't continue without libjunix native library"
104
		echo "Please, fix $PATHDIR/../ThirdPartyBuilds/${PLAT}/java/junixsocket/libjunixsocket-freebsd-1.5-amd64.so"
105
		exit 1
106
	fi
107

  
108
	if [ ! -f $PATHDIR/../ZimbraServer/lib/libzimbra-native.so.FreeBSD.amd64 ]; then
109
		echo "Precompiling ZimbraNative and putting to proper place."
110
		(cd $PATHDIR/../ZimbraNative && $MAKE push)
111
	fi
112
fi
113

  
67 114
echo "Checking for prerequisite binaries"
68 115
for req in ant java
69 116
do
......
83 130
				exit 1;
84 131
			fi
85 132
		elif [ x$req = x"java" ]; then
86
			VERSION=$(${command} -version 2>&1 | grep "java version" | sed -e 's/"//g' | awk '{print $NF}' | awk -F_ '{print $1}')
133
			VERSION=$(${command} -version 2>&1 | grep "version" | sed -e 's/"//g' | awk '{print $NF}' | awk -F_ '{print $1}')
87 134
			MAJOR=`echo $VERSION | awk -F. '{print $1}'`
88 135
			MINOR=`echo $VERSION | awk -F. '{print $2}'`
89 136
			PATCH=`echo $VERSION | awk -F. '{print $3}'`
......
128 175
		echo "http://www.oracle.com/technetwork/java/javase/downloads/index.html"
129 176
		exit 1;
130 177
	fi
178
elif [[ $PLAT == "FreeBSD"* ]]; then
179
	JVERSION=`grep ^JAVA_VERSION $PATHDIR/defs/ThirdParty/$PLAT.def | awk '{print $3}'`
180
	if [ x$AUTO_FETCH_MISSING_FILES_ON_FREEBSD = x"yes" -a ! -f "$PATHDIR/../ThirdPartyBuilds/${PLAT}/java/openjdk${JVERSION}.tgz" ]; then
181
		echo "Warning: openjdk file needed for ZCS packaging not available"
182
		echo "Trying to create required file automatically from local openjdk build."
183
		(mkdir -p $PATHDIR/../ThirdPartyBuilds/${PLAT}/java && \
184
			cd $PATHDIR/../ThirdPartyBuilds/${PLAT}/java && \
185
			rm -rf openjdk${JVERSION} && \
186
			cp -r /usr/local/openjdk${JVERSION} openjdk${JVERSION} && \
187
			tar zcf openjdk${JVERSION}.tgz openjdk${JVERSION})
188
	fi
189
	if [ ! -f "$PATHDIR/../ThirdPartyBuilds/${PLAT}/java/openjdk${JVERSION}.tgz" ]; then
190
		echo "Error: jdk file needed for ZCS packaging not available"
191
		echo "Necessary version is: $JVERSION"
192
		echo "Please create $PATHDIR/../ThirdPartyBuilds/${PLAT}/java/openjdk${JVERSION}.tgz"
193
		echo "Which is an extracted then retarred version of openjdk${JVERSION}"
194
		echo "For more information see /usr/ports/java/openjdk${JVERSION}"
195
		exit 1;
196
	fi
131 197
elif [[ $PLAT != "MACOSX"* ]]; then
132 198
	if [ ! -f $PATHDIR/../ThirdPartyBuilds/i386/java/jdk${JVERSION}.tgz ]; then
133 199
		echo "Error: jdk file needed for ZCS packaging not available"
......
155 221
		echo "http://www.oracle.com/technetwork/java/javase/downloads/index.html"
156 222
		exit 1;
157 223
	fi
224
elif [[ $PLAT == "FreeBSD"* ]]; then
225
	if [ x$AUTO_FETCH_MISSING_FILES_ON_FREEBSD = x"yes" -a ! -f $PATHDIR/../ThirdPartyBuilds/${PLAT}/java/jce/US_export_policy.jar ]; then
226
		echo "Warning: JCE file \"US_export_policy.jar\" needed for ZCS packaging not available"
227
		echo "Trying to fetch from http://zimbra.imladris.sk/download/java/${JVERSION}/US_export_policy.jar"
228
		echo ""
229
		mkdir -p $PATHDIR/../ThirdPartyBuilds/${PLAT}/java/jce
230
		fetch -o $PATHDIR/../ThirdPartyBuilds/${PLAT}/java/jce/US_export_policy.jar http://zimbra.imladris.sk/download/java/${JVERSION}/US_export_policy.jar
231
	fi
232
	if [ ! -f $PATHDIR/../ThirdPartyBuilds/${PLAT}/java/jce/US_export_policy.jar ]; then
233
		echo "Error: JCE file \"US_export_policy.jar\" needed for ZCS packaging not available"
234
		echo "Please create $PATHDIR/../ThirdPartyBuilds/${PLAT}/java/jce/US_export_policy.jar"
235
		echo "Which can be downloaded from"
236
		echo "http://www.oracle.com/technetwork/java/javase/downloads/index.html"
237
		exit 1;
238
	fi
239
	if [ x$AUTO_FETCH_MISSING_FILES_ON_FREEBSD = x"yes" -a ! -f $PATHDIR/../ThirdPartyBuilds/${PLAT}/java/jce/local_policy.jar ]; then
240
		echo "Warning: JCE file \"local_policy.jar\" needed for ZCS packaging not available"
241
		echo "Trying to fetch from http://zimbra.imladris.sk/download/java/${JVERSION}/local_policy.jar"
242
		echo ""
243
		mkdir -p $PATHDIR/../ThirdPartyBuilds/${PLAT}/java/jce
244
		fetch -o $PATHDIR/../ThirdPartyBuilds/${PLAT}/java/jce/local_policy.jar http://zimbra.imladris.sk/download/java/${JVERSION}/local_policy.jar
245
	fi
246
	if [ ! -f $PATHDIR/../ThirdPartyBuilds/${PLAT}/java/jce/local_policy.jar ]; then
247
		echo "Error: JCE file \"local_policy.jar\" needed for ZCS packaging not available"
248
		echo "Please create $PATHDIR/../ThirdPartyBuilds/${PLAT}/java/jce/local_policy.jar"
249
		echo "Which can be downloaded from"
250
		echo "http://www.oracle.com/technetwork/java/javase/downloads/index.html"
251
		exit 1;
252
	fi
158 253
elif [[ $PLAT != "MACOSX"* ]]; then
159 254
	if [ ! -f $PATHDIR/../ThirdPartyBuilds/i386/java/jce/US_export_policy.jar ]; then
160 255
		echo "Error: JCE file \"US_export_policy.jar\" needed for ZCS packaging not available"
......
172 267
	fi
173 268
fi
174 269

  
175
if [ ! -x /usr/bin/rpmbuild -a ! -x /usr/bin/dpkg -a ! -x /Developer/Applications/Utilities/PackageMaker.app/Contents/MacOS/PackageMaker ]; then
270
if [ ! -x /usr/bin/rpmbuild -a ! -x /usr/local/bin/rpmbuild -a ! -x /usr/bin/dpkg -a ! -x /Developer/Applications/Utilities/PackageMaker.app/Contents/MacOS/PackageMaker -a ! -x /usr/sbin/pkg_create ]; then
176 271
	echo "Error: No package building software found."
177
	echo "Make sure one of rpmbuild, dpkg, or PackageMaker is available"
272
	echo "Make sure one of rpmbuild, dpkg, PackageMaker or pkg_create is available"
178 273
	exit 1;
179 274
fi
180 275

  
......
210 305
fi
211 306

  
212 307
TARGETS="sourcetar all"
308
TARGETS="all"
213 309
if [ x$BUILDTYPE = x"network" ]; then
214 310
	if [ -f "$PATHDIR/../ZimbraNetwork/ZimbraBuild/Makefile" ]; then
215 311
		if [ x$RELEASE = x"main" ]; then
......
238 334
echo "Starting ZCS build"
239 335
mkdir -p $PATHDIR/../logs
240 336
if [ x$BUILDTYPE = x"network" ]; then
241
	make -f $PATHDIR/../ZimbraNetwork/ZimbraBuild/Makefile allclean
242
	make -f $PATHDIR/../ZimbraNetwork/ZimbraBuild/Makefile $TARGETS | tee $PATHDIR/../logs/NE-build.log
337
	$MAKE -f $PATHDIR/../ZimbraNetwork/ZimbraBuild/Makefile allclean
338
	$MAKE -f $PATHDIR/../ZimbraNetwork/ZimbraBuild/Makefile $TARGETS | tee $PATHDIR/../logs/NE-build.log
243 339
elif [ x$BUILDTYPE = x"foss" ]; then
244
	make -f Makefile allclean
245
	make -f Makefile $TARGETS | tee $PATHDIR/../logs/FOSS-build.log
340
	$MAKE -f Makefile allclean
341
	$MAKE -f Makefile $TARGETS | tee $PATHDIR/../logs/FOSS-build.log
246 342
else
247 343
	ant -f installer-ant.xml | tee $PATHDIR/../logs/Desktop-build.log
248 344
fi
IRONMAIDEN-808.fbsd/ZimbraBuild/defs/FreeBSD_amd64.def 2014-04-09 14:28:32.000000000 +0200
1
# run pkg_create
2
PACKAGING_COMMAND := pkg_create
3

  
4
# comment, description, install/deinstall scripts are identical, package list, package name
5
PACKAGING_OPTIONS = -c "-Zimbra Collaboration Suite, $(CUR_PACKAGE_NAME)" -d "-Zimbra Collaboration Suite, $(CUR_PACKAGE_NAME)" \
6
	-i "$(PACKAGE_CONF_DIR)/Spec/Scripts/FreeBSD/$(CUR_PACKAGE_NAME)" -k "$(PACKAGE_CONF_DIR)/Spec/Scripts/FreeBSD/$(CUR_PACKAGE_NAME)" \
7
	-f "$(BUILD_ROOT)/$(CUR_PACKAGE_NAME).FreeBSD.plist" $(PACKAGE_DIR)/$(CUR_PACKAGE_NAME)-$(VERSION_TAG)
8

  
9
PACKAGE_EXT := tbz
10

  
11
include $(DEFS_DIR)/plat_common.def
12
include $(DEFS_DIR)/ThirdParty/FreeBSD_amd64.def
IRONMAIDEN-808.fbsd/ZimbraBuild/defs/ThirdParty/FreeBSD_amd64.def 2014-04-10 10:25:22.000000000 +0200
1
ARCH			:= amd64
2

  
3
MYSQL_VERSION		:= standard-$(MYSQL_VERSION_STRING)-FreeBSD-amd64
4
MYSQL_CLIENT_VERSION	:= standard-$(MYSQL_VERSION_STRING)-clientlibs
5

  
6
TCMALLOC_VERSION	:= 2.0
7
TCMALLOC_DIR		:= tcmalloc-$(TCMALLOC_VERSION)
8
TCMALLOC_SOURCE		:= $(THIRD_PARTY_BUILDS)/$(BUILD_PLATFORM)/tcmalloc/$(TCMALLOC_DIR)
9

  
10
SNMP_VERSION		:= 5.7.2
11
SNMP_DIR		:= net-snmp-$(SNMP_VERSION)
12
SNMP_SOURCE		:= $(THIRD_PARTY_BUILDS)/$(BUILD_PLATFORM)/snmp/$(SNMP_DIR)
13

  
14
JAVA_FILE		:= openjdk
15
JAVA_DIR		:= java
16
JAVA_VERSION		:= 7
17
JAVA_SOURCE		:= $(THIRD_PARTY_BUILDS)/$(BUILD_PLATFORM)/$(JAVA_DIR)/$(JAVA_FILE)$(JAVA_VERSION)
18
JAVA_BINARY		:= /opt/zimbra/java/bin/java
19

  
20
JUNIXSOCKET_NATIVE	:= $(THIRD_PARTY_BUILDS)/$(BUILD_PLATFORM)/$(JAVA_DIR)/junixsocket/libjunixsocket-freebsd-1.5-amd64.so
21

  
22
# for compiling
23
JAVA_HOME		:= /usr/local/openjdk7
24

  
25
JCE_SOURCE		:= $(THIRD_PARTY_BUILDS)/$(BUILD_PLATFORM)/$(JAVA_DIR)/jce
26

  
27
LOCAL_LIB_DIR		:= /usr/local/lib
... This diff was truncated because it exceeds the maximum size that can be displayed.