checking in more of the rpm build system (is that it?)
[freeside.git] / rpm / build / BOOTSTRAP
1 # its more notes than a script, so no #!/bin/sh yet
2
3 # s/ivan/username/ in buildsysrc and below
4
5
6 ###
7 # host dirs
8 ###
9
10
11 cd
12 mkdir public_html
13 mkdir mock
14 mkdir redhat
15 mkdir redhat/SRPMS
16 mkdir buildsys
17 mkdir buildsys/ref
18 mkdir buildsys/ref/SRPMS
19
20 cd buildsys
21 for a in build-freeside buildsysrc cvs-check-and-build enrpm expect-addsign expect-signrepo ovid2flute refresh-repo; do
22 ln -s ~/freeside/rpm/build/$a .
23 done
24
25
26 ###
27 # vserver setup
28 ###
29
30
31 #ftp://ftp.pld-linux.org/people/hawk/vserver-templates/Centos
32 #sudo vserver centos5 build -m template --context 5 --hostname centos5.freeside.biz --interface dummy0:10.5.4.5/24 -- -d centos5 -t centos5-i686.tar.bz2
33 sudo vserver centos5 build -m template --context 5 --hostname centos5.freeside.biz --interface dummy0:10.5.4.5/24 -- -d centos5 -t centos5-x86_64.tar.bz2
34
35 #something like this as /etc/init.d/vserver-nat:
36 !/bin/sh
37 iptables -t nat -F
38 iptables -t nat -A POSTROUTING -s 10.5.4.0/24 -d ! 10.5.4.0/24 -j SNAT --to-source 192.168.1.143
39
40 vserver centos5 start
41 vserver centos5 enter
42 #edit /etc/resolv.conf (easier from outside, no vi inside yet)
43
44 yum update
45 yum install openssh-server vim-minimal zsh screen sudo perl patch cvs diffutils rpm-build rsync
46
47 adduser ivan #username
48 cd ~ivan #username
49 mkdir .ssh
50 vi .ssh/authorized_keys
51
52 mkdir redhat
53 mkdir redhat/BUILD
54 mkdir redhat/RPMS
55 mkdir redhat/SOURCES
56 mkdir redhat/SPECS
57 mkdir redhat/SRPMS
58 chown -R ivan:ivan redhat
59
60 vi ~/.rpmmacros
61 %_topdir /home/ivan/redhat
62 %_signature gpg
63 %_gpg_path /home/ivan/.gnupg
64 %_gpg_name Freeside Internet Services, Inc. RPM Signing Key
65
66 vi /etc/ssh/sshd_config #ListenAddress
67 #also need to edit on the host so the vserver can claim its address
68
69 vi /etc/pam.d/sshd
70 #comment out:
71 #session    required     pam_loginuid.so
72
73 /etc/init.d/sshd restart
74
75 vi /etc/sudoers
76
77 exit #and test ssh'ing in
78
79 ###
80 # more...
81 ###
82
83 #copy the stuff from rpm/build/native into /home/ivan (#username) in the vserver
84 cd rpm/build/native
85 for a in build-from-cvs freeside-cvs makesrpm ovid2flute ovid-0.12-1.x86_64.rpm Ovid.diff; do
86   cp $a /var/lib/vservers/centos5/home/ivan/
87 done
88
89 for a in build-from-cvs freeside-cvs makesrpm ovid2flute; do
90   chmod a+rx /var/lib/vservers/centos5/home/ivan/$a
91 done
92
93 vserver centos5 enter #or ssh 10.5.4.5 and sudo
94
95 rpm -i ovid-0.12-1.x86_64.rpm
96 cd /usr/lib/perl5/site_perl/5.*/Ovid
97 patch < ~ivan/Ovid.diff
98
99 #also checkout the necessary freeside versions...
100 export CVSROOT=":pserver:anonymous:anonymous@cvs.freeside.biz:/home/cvs/cvsroot"
101
102 cvs checkout -rFREESIDE_1_7_BRANCH -d freeside-1.7 freeside
103 #cvs checkout -rFREESIDE_1_9_BRANCH -d freeside-1.9 freeside
104
105 ###
106 # yet more
107 ###
108
109 cp expect-* /usr/local/bin/
110 #edit them and set your real passphrase for the gpg key you're using
111
112 ###
113 # references
114 ###
115
116 http://www.freeside.biz/mediawiki/index.php/Freeside:Documentation:CreatingRPMRepo