LP 1190279 Modularize Makefile.install fedora target
[working/Evergreen.git] / Open-ILS / src / extras / install / Makefile.fedora
1 # install files for Fedora
2
3 DIR = $(dir $(lastword $(MAKEFILE_LIST)))
4
5 # Fedora?
6 FEDORA=$(shell uname -r | grep "\.fc[0-9][0-9]\.")
7 # Fedora 64-bit?
8 FEDORA_64=$(shell uname -r | grep "\.fc[0-9][0-9]\.x86_64")
9
10 FEDORA_RPMS = \
11         aspell \
12         aspell-en \
13         bzip2-devel \
14         check \
15         check-devel \
16         libdbi \
17         libdbi-dbd-pgsql \
18         libdbi-devel \
19         libssh2-devel \
20         libyaz \
21         libyaz-devel \
22         mingw32-nsiswrapper \
23         mod_ssl \
24         ncurses-devel \
25         ncurses-libs \
26         perl-parent \
27         perl-Business-CreditCard \
28         perl-Business-ISBN \
29         perl-Business-ISBN-Data \
30         perl-CPAN \
31         perl-DBD-Pg \
32         perl-Email-Send \
33         perl-Email-Simple \
34         perl-GDGraph3d \
35         perl-JSON-XS \
36         perl-LDAP \
37         perl-Library-CallNumber-LC \
38         perl-Locale-Codes \
39         perl-MARC-Charset \
40         perl-MARC-Record \
41         perl-Module-Pluggable \
42         perl-Net-IP \
43         perl-Net-SSH2 \
44         perl-OLE-Storage_Lite \
45         perl-RPC-XML \
46         perl-Spreadsheet-WriteExcel \
47         perl-Test-Warn \
48         perl-Text-Aspell \
49         perl-Text-CSV \
50         perl-Text-CSV_XS \
51         perl-XML-Writer \
52         postgresql-devel \
53         readline-devel \
54         tcp_wrappers-devel \
55         wget \
56         yaz
57
58 export CPAN_MODULES = \
59         MARC::Record \
60         Business::ISBN \
61         Business::ISBN::Data \
62         MARC::Charset \
63         MARC::File::XML \
64         Net::Z3950::ZOOM \
65         Library::CallNumber::LC \
66         Net::Z3950::Simple2ZOOM \
67         Template::Plugin::POSIX \
68         SRU \
69         Rose::URI
70
71 export CPAN_MODULES_FORCE = \
72         Class::DBI::Frozen::301
73
74 # Note: B:O:AuthorizeNet 3.21 fails with https://rt.cpan.org/Public/Bug/Display.html?id=55172
75 # Should be fixed in 3.22
76 # MARC::Record 2.0.1+ is required but only 2.0.0 is packaged
77 #
78 # TODO: can contents of FEDORA_CPAN be moved into CPAN_MODULES_FORCE?
79 FEDORA_CPAN = \
80         Business::OnlinePayment \
81         Business::OnlinePayment::AuthorizeNet \
82         Business::OnlinePayment::PayPal \
83         MARC::File::XML \
84         UUID::Tiny
85
86 PGSQL_FEDORA_RPMS = \
87         postgresql \
88         postgresql-contrib \
89         postgresql-libs \
90         postgresql-plperl \
91         postgresql-server
92
93 all: install_fedora_rpms install_cpan_fedora install_js_sm
94         make -f $(DIR)/Makefile.common install_net_z3950_simpleserver
95         make -f $(DIR)/Makefile.common install_cpan
96         make -f $(DIR)/Makefile.common install_cpan_force
97         make -f $(DIR)/Makefile.common install_libdbi
98
99 install_postgres_server:
100         yum -y install $(PGSQL_FEDORA_RPMS)
101
102 install_fedora_rpms:
103         yum -y update
104         yum -y install $(FEDORA_RPMS)
105
106 install_cpan_fedora: 
107         for m in $(FEDORA_CPAN); do \
108                 echo "force install $$m" | perl -MCPAN -e shell;\
109         done
110
111 install_cpan_marc: install_cpan_marc_record
112         for m in $(CPAN_MODULES_MARC); do perl -MCPAN -e "install \"$$m\";"; done
113
114 install_js_sm: install_libjs install_spidermonkey
115
116 install_libjs: 
117         if [ ! -f $(LIBJS).tar.gz ]; then wget $(LIBJS_URL); fi;
118         tar -zxf $(LIBJS).tar.gz
119         cd js/src/ && JS_DIST=/usr make -f Makefile.ref
120         mkdir -p $(JS_INSTALL_PREFIX)/include/js/
121         cp js/src/*.h $(JS_INSTALL_PREFIX)/include/js/
122         cp js/src/*.tbl $(JS_INSTALL_PREFIX)/include/js/
123         if [ ! -z $(FEDORA_64) ]; then \
124                 cp js/src/Linux_All_DBG.OBJ/*.so $(JS_INSTALL_PREFIX)/lib64/ && \
125                 cp js/src/Linux_All_DBG.OBJ/*.a $(JS_INSTALL_PREFIX)/lib64/; \
126         else \
127                 cp js/src/Linux_All_DBG.OBJ/*.so $(JS_INSTALL_PREFIX)/lib/ && \
128                 cp js/src/Linux_All_DBG.OBJ/*.a $(JS_INSTALL_PREFIX)/lib/; \
129         fi;
130         ldconfig
131
132 install_spidermonkey:
133         if [ ! -f $(LIBJS_PERL).tar.gz ]; then wget $(LIBJS_PERL_URL); fi;
134         tar -zxf $(LIBJS_PERL).tar.gz
135         if [ ! -z $(FEDORA_64) ]; then \
136                 sed -i -e 's/"\/usr\/lib"/"\/usr\/lib64"/' $(LIBJS_PERL)/Makefile.PL ; \
137         fi;
138         if [ ! -z $(FEDORA) ]; then \
139                 sed -i -e 's/js32.dll/libjs.so/' $(LIBJS_PERL)/Makefile.PL ; \
140         fi;
141         cd $(LIBJS_PERL) && perl Makefile.PL -E4X && make && make test && make install
142
143
144 clean:
145         make -f $(DIR)/Makefile.common clean
146
147 # vim:noet:sw=4:ts=4: