Name: pure-ftpdVersion: 1.0.36Release: 1%{?dist}Summary: Pure-FTPd Group: System Environment/DaemonsLicense: BSDURL: http://www.pureftpd.orgSource0: ftp://ftp.pureftpd.org/pub/pure-ftpd/releases/pure-ftpd-1.0.36.tar.bz2Source1: http://machiel.generaal.net/files/pureftpd/ftp_v2.1.tar.gzBuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)Vendor: itnihao@qq.com BuildRequires: gccRequires: shadow-utils%descriptionPure-FTPd is a free (BSD), secure, production-quality and standard-conformant FTP server. It doesn't provide useless bells and whistles, but focuses on efficiency and ease of use. It provides simple answers to common needs, plus unique useful features for personal users as well as hosting providers. %prep%setup -q %build./configure --prefix=/usr/local/pureftpd \--with-mysql \--with-pam \--with-shadow \--with-welcomemsg \--with-uploadscript \--with-cookie \--with-virtualchroot \--with-virtualhosts \--with-diraliases \--with-quotas \--with-puredb \--with-sysquotas \--with-ratios \--with-ftpwho \--with-throttling \--with-language=simplified-chinesemake %{?_smp_mflags}%installrm -rf %{buildroot}make install DESTDIR=%{buildroot}%{__install} -d %{buildroot}%{_sysconfdir}/pureftpd%{__install} -d %{_datadir}%{__install} -d %{buildroot}%{_initrddir}#%{__install} -d %{buildroot}%{_sbindir}%{__install} -d %{buildroot}%{_mandir}/man8/%{__install} -m 755 configuration-file/pure-config.pl %{buildroot}/usr/local/pureftpd/sbin/pure-config.pl%{__install} -m 755 configuration-file/pure-ftpd.conf %{buildroot}%{_sysconfdir}/default.pure-ftpd.conf%{__install} -m 755 configuration-file/pure-ftpd.conf %{buildroot}%{_sysconfdir}/pure-ftpd.conf%{__install} -m 755 pureftpd-mysql.conf %{buildroot}%{_sysconfdir}/default.pureftpd-mysql.confcat >> %{buildroot}%{_sysconfdir}/pureftpd/pureftpd-mysql.conf << EOFMYSQLSocket /var/lib/mysql/mysql.sockMYSQLServer 127.0.0.1MYSQLPort 3306MYSQLUser pureftpuserMYSQLPassword pureftpuserMYSQLDatabase pureftpMYSQLCrypt md5MYSQLGetPW SELECT Password FROM users WHERE User="\L" AND Status="1" AND (Ipaddress = "*" OR Ipaddress LIKE "\R")MYSQLGetUID SELECT Uid FROM users WHERE User="\L" AND Status="1" AND (Ipaddress = "*" OR Ipaddress LIKE "\R")MYSQLGetGID SELECT Gid FROM users WHERE User="\L" AND Status="1" AND (Ipaddress = "*" OR Ipaddress LIKE "\R")MYSQLGetDir SELECT Dir FROM users WHERE User="\L" AND Status="1" AND (Ipaddress = "*" OR Ipaddress LIKE "\R")MySQLGetBandwidthUL SELECT ULBandwidth FROM users WHERE User="\L" AND Status="1" AND (Ipaddress = "*" OR Ipaddress LIKE "\R")MySQLGetBandwidthDL SELECT DLBandwidth FROM users WHERE User="\L" AND Status="1" AND (Ipaddress = "*" OR Ipaddress LIKE "\R")EOF%{__install} -m 755 contrib/redhat.init %{buildroot}%{_initrddir}/pureftpdsed -i\ -e "s|usr/local|usr/local/pureftpd|g" \ -e "s|etc/pure-ftpd.conf|etc/pureftpd/pure-ftpd.conf|g" \%{buildroot}%{_initrddir}/pureftpdsed -i \ -e "s|NoAnonymous no|NoAnonymous yes|g" \ -e "s|# MySQLConfigFile /etc/pureftpd-mysql.conf|MySQLConfigFile /etc/pureftpd/pureftpd-mysql.conf|g" \ -e "s|# Bind 127.0.0.1,21| Bind 127.0.0.1,21|g" \ -e "s|AllowUserFXP no|AllowUserFXP yes|g" \ -e "s|AnonymousCantUpload no|AnonymousCantUpload yes|g" \ -e "s|#CreateHomeDir yes|CreateHomeDir yes|g" \ %{buildroot}%{_sysconfdir}/pure-ftpd.conf #cp conf/pureftpd-mysql.conf %{buildroot}%{_sysconfdir}/pureftpd#cp conf/pure-ftpd.conf %{buildroot}%{_sysconfdir}/pureftpdinstall -m 0644 -p man/pure-authd.8 $RPM_BUILD_ROOT%{_mandir}/man8/pure-authd.8install -m 0644 -p man/pure-ftpd.8 $RPM_BUILD_ROOT%{_mandir}/man8/pure-ftpd.8install -m 0644 -p man/pure-ftpwho.8 $RPM_BUILD_ROOT%{_mandir}/man8/pure-ftpwho.8install -m 0644 -p man/pure-mrtginfo.8 $RPM_BUILD_ROOT%{_mandir}/man8/pure-mrtginfo.8install -m 0644 -p man/pure-pw.8 $RPM_BUILD_ROOT%{_mandir}/man8/pure-pw.8install -m 0644 -p man/pure-pwconvert.8 $RPM_BUILD_ROOT%{_mandir}/man8/pure-pwconvert.8install -m 0644 -p man/pure-quotacheck.8 $RPM_BUILD_ROOT%{_mandir}/man8/pure-quotacheck.8install -m 0644 -p man/pure-statsdecode.8 $RPM_BUILD_ROOT%{_mandir}/man8/pure-statsdecode.8install -m 0644 -p man/pure-uploadscript.8 $RPM_BUILD_ROOT%{_mandir}/man8/pure-uploadscript.8 %{__tar} xf %{SOURCE1} -C $RPM_BUILD_ROOT/%{_datadir}%cleanrm -rf %{buildroot} %files%defattr(-,root,root,-)%doc/usr/local/pureftpd/bin/pure-pw/usr/local/pureftpd/bin/pure-pwconvert/usr/local/pureftpd/bin/pure-statsdecode /usr/local/pureftpd/sbin/pure-authd/usr/local/pureftpd/sbin/pure-config.pl/usr/local/pureftpd/sbin/pure-ftpd/usr/local/pureftpd/sbin/pure-ftpwho/usr/local/pureftpd/sbin/pure-mrtginfo/usr/local/pureftpd/sbin/pure-quotacheck/usr/local/pureftpd/sbin/pure-uploadscript%{_initrddir}/pureftpd%{_sysconfdir}/pureftpd/*%{_mandir}/man8/pure*%{_datadir}/ftp%postgetent group pureftpuser >/dev/null || groupadd -r pureftpusergetent passwd pureftpuser >/dev/null || useradd -r -g pureftpuser -s /sbin/nologin -c "pureftp user" pureftpusersed -i \ -e "s|DBLogin = "ftp";|DBLogin = "pureftpuser";|g" \ -e "s|DBPassword = "tmppasswd";|DBPassword = "pureftpuser";|g" \ -e "s|FTPAddress = "myipaddress.com:21";|FTPAddress = "127.0.0.1:21";|g" \ -e "s|DBDatabase = "ftpusers"|DBDatabase = "pureftp"|g" \ -e "s|DEFUserID = "65534"|DEFUserID = "$ftpuid"|g" \ -e "s|DEFGroupID = "31"|DEFGroupID = "$ftpgid"|g" /usr/share/ftp/config.php/sbin/chkconfig pureftpd oncat <<EOFcreate pureftp database like this:====================================================================================mysql>create database pureftp;mysql>grant all on pureftp.* to pureftpuser@'127.0.0.1' identified by 'pureftpuser';mysql>grant privileges;====================================================================================if you want to use pdb to store password :you should change /etc/pureftpd/pure-ftpd.confsed -i "s|MySQLConfigFile /etc/pureftpd-mysql.conf|# MySQLConfigFile /etc/pureftpd/pureftpd-mysql.conf|g" /etc/pureftpd/pure-ftpd.confsed -i "s|# PureDB /etc/pureftpd.pdb|PureDB /etc/pureftpd/pureftpd.pdb|g" /etc/pureftpd/pure-ftpd.conf#adduser/usr/local/pureftpd/bin/pure-pw useradd virtualftp -f /usr/local/pureftpd/etc/pureftpd.passwd -u 500 -g 500 -d /ftproot#make it into effect/usr/local/pureftpd/bin/pure-pw mkdb /usr/local/pureftpd/etc/pureftpd.pdb -f /usr/local/pureftpd/etc/pureftpd.passwd#modify user password/usr/local/pureftpd/bin/pure-pw passwd virtualftp -f /usr/local/pureftpd/etc/pureftpd.passwd -mEOF%changelog
本文出自 “itnihao的运维技术博客” 博客,请务必保留此出处http://itnihao.blog.51cto.com/1741976/1148570
以上是小编为您精心准备的的内容,在的博客、问答、公众号、人物、课程等栏目也有的相关内容,欢迎继续使用右上角搜索按钮进行搜索conf
, cdh rpmbuild
, install
, local
, PureFTPd
, VirtualHosts
PureFTP
,以便于您获取更多的相关知识。
时间: 2024-12-22 16:43:46