alpher 发表于 2005-3-30 00:15:11

帮忙看一下偶的spec写的哪不对

Name:   vsftpd
Summary: A Very Secure FTP Server Software.
Summary(zh_CN): 一个非常安全的FTP服务器端软件.
Version: 2.0.3
Release: 1mgc
Group:Applications/System
License: GPL
URL:http://vsftpd.beasts.org/
Source: ftp://vsftpd.beasts.org/users/cevans/vsftpd-%{version}.tar.gz
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
#Vendor: MGC Group
#Distribution: Magic Linux
Prefix:%{_prefix}
Prefix:%{_sysconfdir}
#Requires:
#BuildRequires:
Packager:        Alpher<alpher>
%description
vsftpd is an FTP server, or daemon. The "vs" stands for Very Secure. Obviously
this is not a guarantee, but a reflection that I have written the entire
codebase with security in mind, and carefully designed the program to be
resilient to attack.

Recent evidence shows that vsftpd is also extremely fast and scalable. vsftpd
has achieved ~4000 concurrent users on a single machine, in a production
environment.

vsftpd is now a proven stable solution. Of particular note, RedHat used vsftpd
to enable ftp.redhat.com to support 15,000 concurrent users across their
server pool. This extreme load was generated by the release of RedHat 7.2 to
the world.
vsftpd now powers some of the largest and most prestigious sites on the
internet.

%description -l zh_CN.GB2312
vsftpd是一个FTP服务器端,“vs”代表非常安全。

%prep
%setup -n %{name}

%configure
%build
make

%install
rm -rf $RPM_BUILD_ROOT

%makeinstall

%clean
rm -rf $RPM_BUILD_ROOT
rm -rf $RPM_BUILD_DIR/%{name}-%{version}

%post
#添加ftp配置需要的用户和目录
useradd nobody
mkdir /usr/share/empty
mkdir /var/ftp
useradd -d /var/ftp ftp
chown root /var/ftp
chmod og-w /var/ftp
%postun
rm /etc/vsftpd.conf
rm -rf /var/ftp
%files
%defattr(-,root,root)
"/usr/local/sbin/vsftpd"
"/usr/local/man/man5/vsftpd.conf.5"
"/usr/local/man/man8/vsftpd.8"
"/etc/vsftpd.conf"
"/etc/vsftpd.chroot_list"
"/etc/rc.d/init.d/VsFTPd"





%changelog
* Thu Mar 29 2005 alpher <[email protected]>
- initialize the first spec file

alpher 发表于 2005-3-30 00:15:41

出错信息如下
++ find . -name config.guess -o -name config.sub
+ ./configure --build=i686-pc-linux-gnu --host=i686-pc-linux-gnu --target=i686-magic-linux-gnu --program-prefix= --prefix=/usr --exec-prefix=/usr --bindir=/usr/bin --sbindir=/usr/sbin --sysconfdir=/etc --datadir=/usr/share --includedir=/usr/include --libdir=/usr/lib --libexecdir=/usr/libexec --localstatedir=/var --sharedstatedir=/usr/com --mandir=/usr/share/man --infodir=/usr/share/info
/var/tmp/rpm-tmp.26981: line 42: ./configure: No such file or directory
error: Bad exit status from /var/tmp/rpm-tmp.26981 (%prep)


RPM build errors:
    Bad exit status from /var/tmp/rpm-tmp.26981 (%prep)

KDE 发表于 2005-3-30 06:02:26

%setup -n %{name}
问题出在这,-n 后面指定的参数代表 tar 包展开后生成的目录名,一般是不需要的,除非 tar 包名称和展开后生成的目录名不符,或者你要处理多个tar 包。打包时报告找不到 ./configure 说明 -n 参数指定的目录不对,或者软件源代码目录里没有 configure 脚本 (比如你的代码是从 cvs 里 commit out 出来的)。

alpher 发表于 2005-3-30 09:36:35

makefile里面执行这样的操作:
if [ -x /usr/local/sbin ]; then \
      install -m 755 vsftpd /usr/local/sbin/vsftpd; \
      install -m 755 vsftpd.conf /etc/vsftpd.conf; \
      install -m 755 vsftpd.chroot_list /etc/vsftpd.chroot_list; \
      install -m 755 VsFTPd /etc/rc.d/init.d/VsFTPd; \
else \
      install -m 755 vsftpd /usr/sbin/vsftpd; fi
if [ -x /usr/local/man ]; then \
      install -m 644 vsftpd.8 /usr/local/man/man8/vsftpd.8; \
      install -m 644 vsftpd.conf.5 /usr/local/man/man5/vsftpd.conf.5; \
elif [ -x /usr/share/man ]; then \
      install -m 644 vsftpd.8 /usr/share/man/man8/vsftpd.8; \
      install -m 644 vsftpd.conf.5 /usr/share/man/man5/vsftpd.conf.5; \
else \
      install -m 644 vsftpd.8 /usr/man/man8/vsftpd.8; \
      install -m 644 vsftpd.conf.5 /usr/man/man5/vsftpd.conf.5; fi
if [ -x /etc/xinetd.d ]; then \
      install -m 644 xinetd.d/vsftpd /etc/xinetd.d/vsftpd; fi


为什么执行完了之后/var/tmp/vsftp-2.0.3-root目录下面什么都没有,就一个src/debug的目录
难道makefile的操作不是对虚拟目录进行的?

KDE 发表于 2005-3-31 07:11:36

ftp://vsftpd.beasts.org/users/cevans/untar/vsftpd-2.0.3/INSTALL
你应该首先阅读 readme 和 INSTALL 文件。

这个软件没有使用 GNU autotool 创建,而是自己写的 Makefile,这就导致不能按照常规方法打包,非常麻烦。

服务器软件通常都需要大量预配置工作,spec 打包绝非一两天能解决,需要深入研究很多东西和反复实践,建议初学者不要尝试。

alpher 发表于 2005-3-31 09:36:32

不是吧,我现在就是在用vsftp,其实很简单,就是把几个文件拷贝进去而已
没有那么复杂亚

KDE 发表于 2005-3-31 11:24:23

你看看 fedora 的 src.rpm 就知道有多复杂了。服务器可没那么简单,因为涉及权限和安全问题!

alpher 发表于 2005-3-31 15:07:53

55555555
那我换一个软件看看
页: [1]
查看完整版本: 帮忙看一下偶的spec写的哪不对