summaryrefslogtreecommitdiff
path: root/rpm/build/BOOTSTRAP
blob: 6ddf5b54d1225870e092b6ba92dcdfe9dfa1c725 (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
# its more notes than a script, so no #!/bin/sh yet

# s/ivan/username/ in buildsysrc and below


###
# host dirs
###


cd
mkdir public_html
mkdir mock
mkdir redhat
mkdir redhat/SRPMS
mkdir buildsys
mkdir buildsys/ref
mkdir buildsys/ref/SRPMS

cd buildsys
for a in build-freeside buildsysrc cvs-check-and-build enrpm expect-addsign expect-signrepo ovid2flute refresh-repo; do
ln -s ~/freeside/rpm/build/$a .
done


###
# vserver setup
###


#ftp://ftp.pld-linux.org/people/hawk/vserver-templates/Centos
#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
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

#something like this as /etc/init.d/vserver-nat:
!/bin/sh
iptables -t nat -F
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

vserver centos5 start
vserver centos5 enter
#edit /etc/resolv.conf (easier from outside, no vi inside yet)

yum update
yum install openssh-server vim-minimal zsh screen sudo perl patch cvs diffutils rpm-build rsync

adduser ivan #username
cd ~ivan #username
mkdir .ssh
vi .ssh/authorized_keys

mkdir redhat
mkdir redhat/BUILD
mkdir redhat/RPMS
mkdir redhat/SOURCES
mkdir redhat/SPECS
mkdir redhat/SRPMS
chown -R ivan:ivan redhat

vi ~/.rpmmacros
%_gpg_path /home/ivan/.gnupg
%_gpg_name Freeside Internet Services, Inc. RPM Signing Key

vi /etc/ssh/sshd_config #ListenAddress
#also need to edit on the host so the vserver can claim its address

vi /etc/pam.d/sshd
#comment out:
#session    required     pam_loginuid.so

/etc/init.d/sshd restart

vi /etc/sudoers

exit #and test ssh'ing in

###
# more...
###

#copy the stuff from rpm/build/native into /home/ivan (#username) in the vserver
cd rpm/build/native
for a in build-from-cvs freeside-cvs makesrpm ovid2flute ovid-0.12-1.x86_64.rpm Ovid.diff; do
  cp $a /var/lib/vservers/centos5/home/ivan/
done

for a in build-from-cvs freeside-cvs makesrpm ovid2flute; do
  chmod a+rx /var/lib/vservers/centos5/home/ivan/$a
done

vserver centos5 enter #or ssh 10.5.4.5 and sudo

rpm -i ovid-0.12-1.x86_64.rpm
cd /usr/lib/perl5/site_perl/5.*/Ovid
patch < ~ivan/Ovid.diff

#also checkout the necessary freeside versions...
export CVSROOT=":pserver:anonymous:anonymous@cvs.freeside.biz:/home/cvs/cvsroot"

cvs checkout -rFREESIDE_1_7_BRANCH -d freeside-1.7 freeside
#cvs checkout -rFREESIDE_1_9_BRANCH -d freeside-1.9 freeside

###
# yet more
###

cp -i /var/lib/vservers/centos5/etc/yum.repos.d/CentOS-Base.repo /etc/yum/repos.d/
#and s/$releasever/5/g;

cp expect-* /usr/local/bin/
#edit them and set your real passphrase for the gpg key you're using
#(as per that dir above)

###
# and the repository
###

cd
mkdir -p public_html/repo/centos/5/freeside-1.7/testing/x86_64/
mkdir public_html/repo/centos/5/freeside-1.7/testing/i686

###
# and for enrpm!
###

vserver centos5 enter
yum install perl-libwww-perl make
cpan
install RPM::Specfile
#if it fails, might need to go to /root/.cpan/build/RPM-Specfile-* and do it manually
install YAML

#for user cpan-ability
mkdir .cpan
mkdir .cpan/CPAN
cp /usr/lib/perl5/5.8.8/CPAN/Config.pm  .cpan/CPAN/MyConfig.pm
vi .cpan/CPAN/MyConfig.pm #and just leave and change the /root ones
chmod a+rx .cpan/CPAN/MyConfig.pm

#edit ovid2flue and set user

###
# references
###

http://www.freeside.biz/mediawiki/index.php/Freeside:Documentation:CreatingRPMRepo