It has been a long time since I built an RPM using a packages source so I had to brush up on my knowledge there before attempting to build an RPM package for CentOS today from curl’s source. In the process of building the curl RPM package for CentOS I received an error from rpmbuild stating that there was a rather large list of files that were unpackaged. Below I describe the rpmbuild unpackaged error along with a way to resolve the problem. I would love to hear any feedback people have on RPM building since it is not something I do on a regular basis my knowledge is limited.

The below shows the last output from attempting to build a curl RPM package on CentOS Linux from the source provided on the curl download page here.

CentOS rpmbuild Error: Installed (but unpackaged) file(s) found

RPM build errors:
    Installed (but unpackaged) file(s) found:
   /usr/bin/curl-config
   /usr/include/curl/curl.h
   /usr/include/curl/curlbuild.h
   /usr/include/curl/curlrules.h
   /usr/include/curl/curlver.h
   /usr/include/curl/easy.h
   /usr/include/curl/mprintf.h
   /usr/include/curl/multi.h
   /usr/include/curl/stdcheaders.h
   /usr/include/curl/typecheck-gcc.h
   /usr/include/curl/types.h
   /usr/lib/libcurl.a
   /usr/lib/libcurl.la
   /usr/lib/libcurl.so
   /usr/lib/libcurl.so.4
   /usr/lib/libcurl.so.4.2.0
   /usr/lib/pkgconfig/libcurl.pc
   /usr/share/man/man1/curl-config.1.gz
   /usr/share/man/man3/curl_easy_cleanup.3.gz
   /usr/share/man/man3/curl_easy_duphandle.3.gz
   /usr/share/man/man3/curl_easy_escape.3.gz
   /usr/share/man/man3/curl_easy_getinfo.3.gz
   /usr/share/man/man3/curl_easy_init.3.gz
   /usr/share/man/man3/curl_easy_pause.3.gz
   /usr/share/man/man3/curl_easy_perform.3.gz
   /usr/share/man/man3/curl_easy_recv.3.gz
   /usr/share/man/man3/curl_easy_reset.3.gz
   /usr/share/man/man3/curl_easy_send.3.gz
   /usr/share/man/man3/curl_easy_setopt.3.gz
   /usr/share/man/man3/curl_easy_strerror.3.gz
   /usr/share/man/man3/curl_easy_unescape.3.gz
   /usr/share/man/man3/curl_escape.3.gz
   /usr/share/man/man3/curl_formadd.3.gz
   /usr/share/man/man3/curl_formfree.3.gz
   /usr/share/man/man3/curl_formget.3.gz
   /usr/share/man/man3/curl_free.3.gz
   /usr/share/man/man3/curl_getdate.3.gz
   /usr/share/man/man3/curl_getenv.3.gz
   /usr/share/man/man3/curl_global_cleanup.3.gz
   /usr/share/man/man3/curl_global_init.3.gz
   /usr/share/man/man3/curl_global_init_mem.3.gz
   /usr/share/man/man3/curl_mprintf.3.gz
   /usr/share/man/man3/curl_multi_add_handle.3.gz
   /usr/share/man/man3/curl_multi_assign.3.gz
   /usr/share/man/man3/curl_multi_cleanup.3.gz
   /usr/share/man/man3/curl_multi_fdset.3.gz
   /usr/share/man/man3/curl_multi_info_read.3.gz
   /usr/share/man/man3/curl_multi_init.3.gz
   /usr/share/man/man3/curl_multi_perform.3.gz
   /usr/share/man/man3/curl_multi_remove_handle.3.gz
   /usr/share/man/man3/curl_multi_setopt.3.gz
   /usr/share/man/man3/curl_multi_socket.3.gz
   /usr/share/man/man3/curl_multi_socket_action.3.gz
   /usr/share/man/man3/curl_multi_strerror.3.gz
   /usr/share/man/man3/curl_multi_timeout.3.gz
   /usr/share/man/man3/curl_share_cleanup.3.gz
   /usr/share/man/man3/curl_share_init.3.gz
   /usr/share/man/man3/curl_share_setopt.3.gz
   /usr/share/man/man3/curl_share_strerror.3.gz
   /usr/share/man/man3/curl_slist_append.3.gz
   /usr/share/man/man3/curl_slist_free_all.3.gz
   /usr/share/man/man3/curl_strequal.3.gz
   /usr/share/man/man3/curl_unescape.3.gz
   /usr/share/man/man3/curl_version.3.gz
   /usr/share/man/man3/curl_version_info.3.gz
   /usr/share/man/man3/libcurl-easy.3.gz
   /usr/share/man/man3/libcurl-errors.3.gz
   /usr/share/man/man3/libcurl-multi.3.gz
   /usr/share/man/man3/libcurl-share.3.gz
   /usr/share/man/man3/libcurl-tutorial.3.gz
   /usr/share/man/man3/libcurl.3.gz

Getting around this rpmbuild error is fairly simple depending on the amount of files that are unpackaged. All you need to do is update your .spec file you are using to build the RPM package. For instance in this case my spec file is named curl.spec and located in the “~/rpmbuild/SPECS/” directory. All I needed to do was copy the above list of files specified in the error and add them to the SPEC file as displayed in the below SPEC file example. Each of these files will need to be underneath the “%files” option in the spec file.

Curl SPEC File Example: Adding Unpackaged Files

# This is a sample spec file for wget

%define _topdir         /home/alex/rpmbuild
%define name                    curl
%define release         1
%define version         7.20.0
%define buildroot %{_topdir}/%{name}-%{version}-root

BuildRoot:      %{buildroot}
Summary:                GNU wget
License:                GPL
Name:                   %{name}
Version:                %{version}
Release:                %{release}
Source:                 %{name}-%{version}.tar.gz
Prefix:                 /usr
Group:                  Development/Tools

%description
curl 7.20

%prep
%setup -q

%build
./configure
make

%install
make install prefix=$RPM_BUILD_ROOT/usr

%files
%defattr(-,root,root)
/usr/bin/curl
/usr/bin/curl-config
/usr/include/curl/curl.h
/usr/include/curl/curlbuild.h
/usr/include/curl/curlrules.h
/usr/include/curl/curlver.h
/usr/include/curl/easy.h
/usr/include/curl/mprintf.h
/usr/include/curl/multi.h
/usr/include/curl/stdcheaders.h
/usr/include/curl/typecheck-gcc.h
/usr/include/curl/types.h
/usr/lib/libcurl.a
/usr/lib/libcurl.la
/usr/lib/libcurl.so
/usr/lib/libcurl.so.3
/usr/lib/libcurl.so.3.0.0
/usr/lib/libcurl.so.4
/usr/lib/libcurl.so.4.2.0
/usr/lib/pkgconfig/libcurl.pc
/usr/share/man/man1/curl-config.1.gz
/usr/share/man/man3/curl_easy_cleanup.3.gz
/usr/share/man/man3/curl_easy_duphandle.3.gz
/usr/share/man/man3/curl_easy_escape.3.gz
/usr/share/man/man3/curl_easy_getinfo.3.gz
/usr/share/man/man3/curl_easy_init.3.gz
/usr/share/man/man3/curl_easy_pause.3.gz
/usr/share/man/man3/curl_easy_perform.3.gz
/usr/share/man/man3/curl_easy_recv.3.gz
/usr/share/man/man3/curl_easy_reset.3.gz
/usr/share/man/man3/curl_easy_send.3.gz
/usr/share/man/man3/curl_easy_setopt.3.gz
/usr/share/man/man3/curl_easy_strerror.3.gz
/usr/share/man/man3/curl_easy_unescape.3.gz
/usr/share/man/man3/curl_escape.3.gz
/usr/share/man/man3/curl_formadd.3.gz
/usr/share/man/man3/curl_formfree.3.gz
/usr/share/man/man3/curl_formget.3.gz
/usr/share/man/man3/curl_free.3.gz
/usr/share/man/man3/curl_getdate.3.gz
/usr/share/man/man3/curl_getenv.3.gz
/usr/share/man/man3/curl_global_cleanup.3.gz
/usr/share/man/man3/curl_global_init.3.gz
/usr/share/man/man3/curl_global_init_mem.3.gz
/usr/share/man/man3/curl_mprintf.3.gz
/usr/share/man/man3/curl_multi_add_handle.3.gz
/usr/share/man/man3/curl_multi_assign.3.gz
/usr/share/man/man3/curl_multi_cleanup.3.gz
/usr/share/man/man3/curl_multi_fdset.3.gz
/usr/share/man/man3/curl_multi_info_read.3.gz
/usr/share/man/man3/curl_multi_init.3.gz
/usr/share/man/man3/curl_multi_perform.3.gz
/usr/share/man/man3/curl_multi_remove_handle.3.gz
/usr/share/man/man3/curl_multi_setopt.3.gz
/usr/share/man/man3/curl_multi_socket.3.gz
/usr/share/man/man3/curl_multi_socket_action.3.gz
/usr/share/man/man3/curl_multi_strerror.3.gz
/usr/share/man/man3/curl_multi_timeout.3.gz
/usr/share/man/man3/curl_share_cleanup.3.gz
/usr/share/man/man3/curl_share_init.3.gz
/usr/share/man/man3/curl_share_setopt.3.gz
/usr/share/man/man3/curl_share_strerror.3.gz
/usr/share/man/man3/curl_slist_append.3.gz
/usr/share/man/man3/curl_slist_free_all.3.gz
/usr/share/man/man3/curl_strequal.3.gz
/usr/share/man/man3/curl_unescape.3.gz
/usr/share/man/man3/curl_version.3.gz
/usr/share/man/man3/curl_version_info.3.gz
/usr/share/man/man3/libcurl-easy.3.gz
/usr/share/man/man3/libcurl-errors.3.gz
/usr/share/man/man3/libcurl-multi.3.gz
/usr/share/man/man3/libcurl-share.3.gz
/usr/share/man/man3/libcurl-tutorial.3.gz
/usr/share/man/man3/libcurl.3.gz

%doc %attr(0444,root,root) /usr/share/man/man1/curl.1.gz

On the next attempt to build the curl package from source using rpmbuild I didn’t have any issues. I will be writing a couple more articles related to building RPM’s in the next day or so as I ran into a couple different issues and noting them here should help others that are new to RPM building.

Linux Cookbook (Paperback)

By (author): Carla Schroder


List Price: $49.99 USD
New From: $17.47 USD In Stock
Used from: $5.14 USD In Stock


List Price: $39.99 USD
New From: $19.95 USD In Stock
Used from: $0.41 USD In Stock

DeliciousStumbleUponDiggTwitterFacebookRedditLinkedInEmail
Tags: , , , , , , , , , , , ,
Leave a Reply

*Type the letter/number combination in the abvoe field before clicking submit.

*