Name: ddcw #名字
Version: 2019 #版本
Release: 1125
Summary: this is test RPM
Group: Applications/System
License: ddcw
URL: https://blog.51cto.com/10888845
#Requires:
Requires:grep #依赖,即安装这个软件所需的其它RPM包
%description #描述
this is set ddcw some habit
%prep #安装前所需要做的事情
echo -e "\033[1;41;33m pre install NOTHING\033[0mprep"
%build #这个我也不知道
echo -e "\033[1;41;33m build NOTHING\033[0mprep"
%install #安装,即把自己的脚本放到那个位置
#echo -e "\033[1;41;33m install NOTHING\033[0mprep"
mkdir -p %{buildroot}/tmp/ddcw
install -m 744 scanport.sh %{buildroot}/tmp/ddcw/scanport.sh
install -m 744 setRM.sh %{buildroot}/tmp/ddcw/setRM.sh
install -m 744 customOS.sh %{buildroot}/tmp/ddcw/customOS.sh
%post #安装之后的工作,(因为我的脚本自带安装功能,即执行脚本他会自动安装)
sh /tmp/ddcw/scanport.sh
sh /tmp/ddcw/setRM.sh
sh /tmp/ddcw/customOS.sh
%files #文件
/tmp/ddcw/scanport.sh
/tmp/ddcw/setRM.sh
/tmp/ddcw/customOS.sh
%postun #卸载操作,即运行 rpm -e 软件包 的时候执行的命令
mv /usr/bin/scanportDDCW /tmp
sed -i "/alias rm='\/bin\/rms'/d" /etc/profile >/dev/null
sed -i "/export HISTTIMEFORMAT=/d" /etc/profile >/dev/null
sed -i "/export DISPLAY=/d" /etc/profile >/dev/null
sed -i "/export PS1=/d" /etc/profile >/dev/null
%changelog #对于我来说,没啥用