我是rpmbuild的新手,搜索并复制了一个spec文件参数,并成功地创建了rpm。当我运行它时,没有创建任何rpm。
var.tar.gz -- this is my tar file. it has
var/
var/www/
var/www/html/index.html我的规范文件
[root@kaka1 SPECS]# vi var.spec
Name: var
Version: 1
Release: 0
Summary: Xiph Streaming media server that supports multiple formats.
Group: Applications/Multimedia
License: GPL
URL: http################
Source: var-1.0.tar.gz
Prefix: %{_prefix}
Packager: Sukama
BuildRoot: %{_tmppath}/%{name}-root
%description
easily and supports open standards for commuincation and interaction.
%prep
rm -rf /root/rpmbuild/BUILD/*
%setup -n var
gzip -dc /root/rpmbuild/SOURCES/var-1.0.tar.gz| tar -xvvf -
if [ $? -ne 0 ]; then
exit $?
fi你能帮我在哪里提到我要在根目录下创建的文件吗?
发布于 2018-02-14 22:56:04
首先,不要使用像var,usr这样的名称作为包的名称,使用与包可能代表的内容更相关的名称。下面是一个简单的spec文件,可以将index.html安装到/var/www目录中。
%define debug_package %{nil}
Summary: Simple SPEC
Name: simple
Version: 0
Release: 1
License: NONE # Use your suitable license
Group: NONE
URL: NONE
Source0: %{name}-%{version}.tar.gz
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
## Following lines are commented out, but that's the way to go
#BuildRequires: httpd # This needs https RPM during your build
#Requires: httpd # This would require httpd to be installed for this RPM
%description
%prep
%setup -q # This untars the source
%build # currently empty
%install # This moves into the source directory "simple-0" (see below)
rm -rf $RPM_BUILD_ROOT
mkdir -p $RPM_BUILD_ROOT/var/www
install -m 0644 index.html %{buildroot}/var/www/index.html
%clean
rm -rf $RPM_BUILD_ROOT
%post
%files
%defattr(-,root,root,-)
%doc
/var/www/index.html # Your packages owns the file, but not the directories
%changelog
* Web Feb 14 2018 <user@localhost> - 0.0
- Initial build.对于上面的.spec文件,需要一个名为simple-0.tar.gz的tarball。它映射到在.spec中使用的Source0名称。本例中的内容是一个目录和一个文件:simple-0/index.html。
https://stackoverflow.com/questions/48772106
复制相似问题