rpm -ivh postfix-2.3.6-1.src.rpm [~] 1:postfix-2.3.6-1 ########################################### [100%]
vi postfix.spec %build # %buildセクションに追加 . . . make makefiles CCARGS="${CCARGS} -I/usr/include/sasl" AUXLIBS="${AUXLIBS} -L%{sasl_lib_dir} -lsasl2" # 追加 make makefiles CCARGS="-DUSE_SASL_AUTH -DUSE_CYRUS_SASL -I/usr/include/sasl" AUXLIBS="-L/usr/lib -lsasl2" make DEBUG="" OPT="$RPM_OPT_FLAGS"
# install までが上手く行くかのテスト( %prep, %build, %installが実行される) rpmbuild -bi postfix.spec # ちなみに、make までが上手く行くかのテスト( %prep, %buildが実行される) rpmbuild -bc postfix.spec
# バイナリパッケージ作成 rpmbuild -bb postfix.spec # バイナリとソースパッケージ作成(両方ほしいのなら) rpmbuild -ba postfix.spec
# i386に無い場合もあるのでその場合はRPMS直下のその他のディレクトリを探す rpm -ivh /usr/src/redhat/RPMS/i386/postfix-2.3.6-1_smtpauth.i386.rpm
exclude=postfix*
# rpmとsrpmを作成 rpmbuild -ta archive.tar.gz # rpmのみ rpmbuild -tb archive.tar.gz # srpmのみ rpmbuild -ts archive.tar.gz
wget http://asic-linux.com.mx/%7Eizto/checkinstall/files/rpm/checkinstall-1.6.1-1.i386.rpm rpm -ivh checkinstall-1.6.1-1.i386.rpm Preparing... ########################################### [100%] 1:checkinstall ########################################### [100%]
checkinstall The package documentation directory ./doc-pak does not exist. Should I create a default set of package docs? [y]:y ←「y」を入力して[Enter]キーを押す (省略) Please choose the packaging method you want to use. Slackware [S], RPM [R] or Debian [D]?r ←「r」を入力して[Enter]キーを押す Please write a description for the package. End your description with an empty line or EOF. >> ←[Enter]キーを押す This package will be built according to these values: 1 - Summary: [ Package created with checkinstall 1.6.1 ] 2 - Name: [ parrot ] 3 - Version: [ 1.0.0 ] 4 - Release: [ 1 ] 5 - License: [ GPL ] 6 - Group: [ Applications/System ] 7 - Architecture: [ i386 ] 8 - Source location: [ parrot-1.0.0 ] 9 - Alternate source location: [ ] 10 - Requires: [ ] 11 - Provides: [ parrot ] Enter a number to change any of them or press ENTER to continue (省略) ********************************************************************** Done. The new package has been saved to /usr/src/redhat/RPMS/i386/parrot-1.0.0-1.i386.rpm You can install it in your system anytime using: rpm -i parrot-1.0.0-1.i386.rpm **********************************************************************例ではCentOSでparrotのパッケージが無かったので作った時のメモ。ちなみにインストールしようとすると
error: unpacking of archive failed on file /bin/cat;4a96c3d3: cpio: MD5 sum mismatchなどと出ることがあるので、その場合は--nomd5オプションをつけてインストールするとよい
ERROR: ld.so: object '/usr/local/lib/installwatch.so' from LD_PRELOAD cannot be preloaded: ignored.以下のようにしておくこと
ln -s /usr/local/lib/installwatch.so /usr/local/lib64/installwatch.so
wget http://dag.wieers.com/rpm/packages/rpmforge-release/rpmforge-release-0.3.6-1.el5.rf.i386.rpm rpm -ivh rpmforge-release-0.3.6-1.el5.rf.i386.rpm
sed -i.org -e "s/^\(enabled\) = 1/\1 = 0/" /etc/yum.repos.d/rpmforge.repo
sed -i.org -e "s/^\(enabled\)=1/\1=0/" /etc/yum.repos.d/epel.repo
wget http://download.fedora.redhat.com/pub/epel/5/$(uname -i)/epel-release-5-3.noarch.rpm rpm -ivh epel-release-5-3.noarch.rpm
wget http://rpm.livna.org/livna-release.rpm rpm -ivh livna-release.rpm sed -i.org -e "s/^\(enabled\)=1/\1=0/" /etc/yum.repos.d/livna.repo
wget http://download1.rpmfusion.org/free/el/updates/testing/5/i386/rpmfusion-free-release-5-0.1.noarch.rpm wget http://download1.rpmfusion.org/nonfree/el/updates/testing/5/i386/rpmfusion-nonfree-release-5-0.1.noarch.rpm rpm -ivh rpmfusion-*.rpm sed -i.org -e "s/^\(enabled\)=1/\1=0/g" /etc/yum.repos.d/rpmfusion-free-updates.repo sed -i.org -e "s/^\(enabled\)=1/\1=0/g" /etc/yum.repos.d/rpmfusion-free-updates-testing.repo sed -i.org -e "s/^\(enabled\)=1/\1=0/g" /etc/yum.repos.d/rpmfusion-nonfree-updates.repo sed -i.org -e "s/^\(enabled\)=1/\1=0/g" /etc/yum.repos.d/rpmfusion-nonfree-updates-testing.repo
yum --enablerepo=rpmfusion-free-updates --enablerepo=rpmfusion-nonfree-updates list
cat <<EOL > /etc/yum.repos.d/atrpms.repo [atrpms] name=Redhat Enterprise Linux \$releasever - \$basearch - ATrpms baseurl=http://dl.atrpms.net/el\$releasever-\$basearch/atrpms/stable enabled=0 gpgcheck=1 gpgkey=http://atrpms.net/RPM-GPG-KEY.atrpms EOL # GPGkeyを取り込む rpm --import http://atrpms.net/RPM-GPG-KEY.atrpms
wget http://download.fedora.redhat.com/pub/epel/5/$(uname -i)/epel-release-5-3.noarch.rpm rpm -ivh epel-release-5-3.noarch.rpm
chkconfig yumupdated off chkconfig yum-cron on # 起動 /etc/rc.d/init.d/yum-cron start
# 日本語ででるので、英語で見たい場合はLANG=Cすること LANG=C yum grouplist Installed Groups: Dialup Networking Support Editors Mail Server MySQL Database Network Servers PostgreSQL Database System Tools Web Server Yum Utilities Available Groups: Administration Tools Authoring and Publishing Base Beagle Cluster Storage Clustering DNS Name Server Development Libraries Development Tools Emacs Engineering and Scientific FTP Server FreeNX and NX GNOME Desktop Environment GNOME Software Development Games and Entertainment Graphical Internet Graphics Horde Java Java Development KDE (K Desktop Environment) KDE Software Development KVM Legacy Network Server Legacy Software Development Legacy Software Support Mono News Server Office/Productivity OpenFabrics Enterprise Distribution Printing Support Ruby Server Configuration Tools Sound and Video Text-based Internet Tomboy Virtualization Windows File Server X Software Development X Window System XFCE-4.4 Done **groupをインストール =|BOX| yum groupinstall $group
# ダウンロード /usr/local/bin/cpanp d File::Find::Rule [~] [MSG] No '/root/.cpanplus/custom-sources' dir, skipping custom sources Successfully fetched 'File::Find::Rule' to '/root/.cpanplus/authors/id/R/RC/RCLAMP/File-Find-Rule-0.30.tar.gz' # RPM作成 cpanflute2 /root/.cpanplus/authors/id/R/RC/RCLAMP/File-Find-Rule-0.30.tar.gz 書き込み完了: ./perl-File-Find-Rule-0.30-8.src.rpm 実行中(--clean): /bin/sh -e /var/tmp/rpm-tmp.12412 + umask 022 + cd /tmp/plXK3FVpis + rm -rf File-Find-Rule-0.30 + exit 0SRPMが作成されるので、これをインストールすればよい。SRPMのインストールの仕方はSRPMをインストール参照
#!/bin/sh CHROOT=/chroot proc=$CHROOT/proc sys=$CHROOT/sys etc=$CHROOT/etc dev=$CHROOT/dev var=$CHROOT/var rm -fr $CHROOT mkdir $CHROOT for dir in $etc $dev $proc $sys $var; do mkdir $dir done for makedev in console null zero; do MAKEDEV -d $dev -x $makedev done cp -p /etc/resolv.conf $etc cat <<EOL >$etc/fstab /dev/sda1 / ext3 defaults 1 1 devpts /dev/pts devpts gid=5,mode=620 0 0 tmpfs /dev/shm tmpfs defaults 0 0 proc /proc proc defaults 0 0 sysfs /sys sysfs defaults 0 0 /dev/sda2 swap swap defaults 0 0 EOL mount --bind /proc $proc mount --bind /sys $sys yum clean all cp -a /etc/yum* $etc # $releaseverがnullになってしまうため、値をいれておく。/etc/redhat-releaseのバージョン参照。5.5なら5みたいな感じで sed -i -e 's/$releasever/5/g' $etc/yum.repos.d/*.repo yum -y --installroot=$CHROOT groupinstall "Base" umount $proc umount $sys
curl -LO http://nginx.org/packages/rhel/6/noarch/RPMS/nginx-release-rhel-6-0.el6.ngx.noarch.rpm rpm -ivh nginx-release-rhel-6-0.el6.ngx.noarch.rpm sed -e 's/enable=1/enable=0/' /etc/yum.repos.d/nginx.repoあとは↓でインストールできる
yum install --enablerepo=nginx nginx
curl -LO http://yum.pgrpms.org/reporpms/9.1/pgdg-centos-9.1-1.noarch.rpm rpm -ivh pgdg-centos-9.1-1.noarch.rpm使うときは
yum install --enablerepo=pgdg91 postgresql91 postgresql91-docs postgresql91-libs postgresql91-serverとすると最新のpostgresをrpmでインストールできる
libgpg-error-devel-1.4-2.x86_64 from base has depsolving problems --> Missing Dependency: libgpg-error = 1.4-2 is needed by package libgpg-error-devel-1.4-2.x86_64 (base) Error: Missing Dependency: libgpg-error = 1.4-2 is needed by package libgpg-error-devel-1.4-2.x86_64 (base) You could try using --skip-broken to work around the problem You could try running: package-cleanup --problems package-cleanup --dupes rpm -Va --nofiles --nodigestとなった。libgpg-error-develがyumでは見つからないらしく、依存解決できない。atrpmにあったようなので
curl -LO http://dl.atrpms.net/el5-x86_64/atrpms/stable/libgpg-error-devel-1.6-10.el5.x86_64.rpm rpm -ivh libgpg-error-devel-1.6-10.el5.x86_64.rpmとして解決する