source: server/fedora/Makefile @ 61

Last change on this file since 61 was 61, checked in by jbarnold, 17 years ago
updated install-build-deps for mit-zephyr; updated issue.net for new Athena ssh
File size: 4.7 KB
RevLine 
[1]1# Makefile for building scripts.mit.edu Fedora packages
2# Copyright (C) 2006  Jeff Arnold <jbarnold@mit.edu>
3#                and  Joe Presbrey <presbrey@mit.edu>
4#
5# This program is free software; you can redistribute it and/or
6# modify it under the terms of the GNU General Public License
7# as published by the Free Software Foundation; either version 2
8# of the License, or (at your option) any later version.
9#
10# This program is distributed in the hope that it will be useful,
11# but WITHOUT ANY WARRANTY; without even the implied warranty of
12# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13# GNU General Public License for more details.
14#
15# You should have received a copy of the GNU General Public License
16# along with this program; if not, write to the Free Software
17# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
18#
19# See /COPYRIGHT in this repository for more information.
20
21upstream        = openafs krb5 httpd
[58]22oursrc          = execsys tokensys accountadm sqladm httpdmods
[1]23allsrc          = $(upstream) $(oursrc)
24oursrcdir       = ${PWD}/../common/oursrc
25patches         = ${PWD}/../common/patches
[59]26metapatches     = ${PWD}/meta-patches
[1]27specs           = ${PWD}/specs
28
29topdir          = ${PWD}/.tmp
30tmp_build       = ${PWD}/.tmp/BUILD
31tmp_specs       = ${PWD}/.tmp/SPECS
32tmp_src         = ${PWD}/.tmp/SOURCES
33out_rpms        = ${PWD}/RPMS
34out_srpms       = ${PWD}/SRPMS
35tree            = $(topdir) $(tmp_build) $(tmp_specs) $(tmp_src) $(out_rpms) $(out_srpms) 
36out_sbin        = ${PWD}/sbin
37
38dload           = ${PWD}/.dload
39server_url      = "http://scripts.mit.edu/src"
40server_arch     = "fedora.stable"
41
[13]42rpm_args        = -E '%define _smp_mflags -j4' -E '%define _topdir $(topdir)' -E '%define _rpmdir $(out_rpms)' -E '%define _srcrpmdir $(out_srpms)'
43#-E '%define kernvers %(rpm -q --whatprovides kernel | sort | tail -1)'
[1]44
45.PHONY: minimal-clean
46
47info:
48        @echo "The following packages are available:"; \
49        echo "$(allsrc)"; \
50        echo "Run 'make all' to build all packages."
51
52minimal-clean:
53        rm -rf $(topdir) $(dload)
54
55clean: minimal-clean
56        rm -rf $(out_rpms) $(out_srpms) $(out_sbin)
57
58mkdir-tree:
59        @mkdir -p $(tree);
60
61download:
62        -@wget -O- -nv $(server_url)/$(server_arch) | wget -i- -nv -nc -B $(server_url)/ -nd -nH -P $(dload);
63
64copy-patches: mkdir-tree
[59]65        @cp $(patches)/*.patch $(tmp_src); \
66        cd $(tmp_src); \
67        list=`ls $(metapatches)/*.patch`; \
68        for i in $$list; do \
69                patch < $$i; \
70        done;
[1]71
72install-srpms: mkdir-tree download
73        rpm $(rpm_args) -i $(dload)/*.src.rpm 2>/dev/null;
74
75copy-specs: mkdir-tree
76        cp ${specs}/*.spec $(tmp_specs)
77
78patch-specs: install-srpms
79        @cd ${tmp_specs}; \
80        list=`ls ${specs}/*.spec.patch`; \
81        for i in $$list; do \
82                patch < $$i; \
83        done;
84
85# 1. use the package's Makefile to delete leftover files and run autoconf
86# 2. create a tarball (we want it to contain the autoconf output)
87create-tarballs: mkdir-tree
88        @cd ${oursrcdir}; \
[31]89        list=`find -mindepth 1 -maxdepth 1 -type d | grep -v ".svn"`; \
[1]90        for i in $$list; do \
91                pushd $$i; \
[36]92                ./mrproper; \
[1]93                autoconf; \
94                popd; \
95                tar -czf $(tmp_src)/$$i.tar.gz $$i; \
96        done;
97
98setup: install-srpms copy-patches copy-specs patch-specs create-tarballs
99
100# Do not work:
101#rpms: setup
102#       rpmbuild $(rpm_args) -bb ${tmp_specs}/$(allsrc);
103#
104#srpms: setup
105#       rpmbuild $(rpm_args) -bs ${tmp_specs}/$(allsrc);
106
107oursrc:
108        make $(oursrc)
109
110upstream:
111        make $(upstream)
112
113all:
114        make $(allsrc)
115
116$(allsrc): setup
[11]117        PATH="/usr/kerberos/sbin:/usr/kerberos/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin" \
[1]118        rpmbuild $(rpm_args) -ba ${tmp_specs}/$@*.spec
119
[6]120suexec: install-srpms
[1]121        @rm -rf ${tmp_src}/httpd-2*/; \
122        tar zxvf ${tmp_src}/httpd-2*.tar.gz; \
[8]123        cd httpd-2*; \
[1]124        patch -p1 < ${patches}/httpd-suexec-scripts.patch; \
125        ./configure --prefix=/etc/httpd --with-suexec-userdir=web_scripts --with-suexec-caller=apache --with-suexec-uidmin=50 --with-suexec-gidmin=50 --with-suexec-docroot=/; \
[8]126        pushd support; \
[1]127        make suexec && mkdir ${out_sbin} && cp suexec ${out_sbin}; \
[8]128        popd; \
129        rm -rf httpd-2*; \
[1]130        echo; \
131        echo "suexec binary written to ${out_sbin}."; \
132        echo "Run 'make install-suexec' as root to install it.";
133
134install-suexec:
135        install -m 4510 -o 0 -g apache ${PWD}/sbin/suexec /usr/sbin/;
[36]136
137# The following packages are needed for *building* all of our packages
[61]138# basic deps: kernel-devel through autoconf
[36]139# oursrc: hesinfo
140# httpd: xmlto through distcache-devel
141# krb5: bison through texinfo
142# openafs: pam-devel through automake
[61]143# mit-zephyr: readline-devel
[36]144install-build-deps:
[61]145        yum -y install kernel-devel rpm-build gcc autoconf hesinfo xmlto db4-devel expat-devel zlib-devel libselinux-devel apr-devel apr-util-devel pcre-devel openssl-devel distcache-devel bison ncurses-devel texinfo pam-devel automake readline-devel
[36]146
147# The following packages are needed for *installing* all of our packages
148install-deps:
149        yum -y krb5-workstation
Note: See TracBrowser for help on using the repository browser.