打印

wine RPM包制作问题

wine RPM包制作问题

近来想制作一个wine的rpm包,我尝试用src.rpm的包来rpmbuild --rebuild
一个适合我系统rpm包,但是出来的rpm包有50多m,而别人才有12m。这是为什么呢?

也尝试了用别人的sepc,小量修改后来做我的rpm包。同样作出 50m 大小。

我又解压了其他系统的wine rpm包,对比里面的文件和我编译安装的wine文件,发现里面的dll.so的文件大小和我编译安装的dll.so文件大小相差很大。这是为什么呢??

不明白。

TOP

看看kanker的spec

TOP

[quote:618b07b5f4="demonlj"]看看kanker的spec[/quote]

那个spec在那里?

TOP

找wine的src包

TOP

看看 ./configure 的参数和 %file 字段。
关闭 debug 可以缩小很多,-Os 比 -O2 也能减小。

TOP

thanks 我看看
debug怎么关闭?

TOP

一般--disable-debug就可以吧,你用./configure --help察看下就知了

TOP

[quote:2460e029a3="demonlj"]一般--disable-debug就可以吧,你用./configure --help察看下就知了[/quote]

[code:1]%define DATE 20050628
Summary: A Windows 16/32 bit emulator.
Name: wine
Version: %{DATE}
Release: RetFlag5
Group: Applications/Emulators
License: LGPL
URL: http://www.winehq.org/
Source0: ftp://metalab.unc.edu/pub/Linux/ALPHA/wine/development/Wine-%{version}.tar.gz
Source1: wine.init
Source2: wine-fonts-%{version}.tar.gz
Patch0: wine-%{version}-stabs+.patch
Patch1: wine-%{version}-nvidia-opengl.patch
Patch2: wine-%{version}-generated.patch
Buildroot: %{_tmppath}/%{name}-%{version}-root
ExclusiveArch: %{ix86}
BuildRequires: autoconf, gcc, binutils, bison, flex
Requires: glibc >= 2.3.2-27.9.7

%description
While Wine is usually thought of as a Windows(TM) emulator, the Wine
developers would prefer that users thought of Wine as a Windows
compatibility layer for UNIX. This package includes a program loader,
which allows unmodified Windows 3.1/95/NT binaries to run under Intel
Unixes. Wine does not require MS Windows, but it can use native system
.dll files if they are available.

%package devel
ExclusiveArch: i386
Summary: Wine development environment.
Group: System Environment/Libraries
Requires: wine = %{version}

%description devel
Header, include files and library definition files for developing applications
with the Wine Windows(TM) emulation libraries.

%prep
%setup -q -n wine-%{version}
%patch0 -p1 -b .stabs+
%patch1 -p1 -b .nvidia-opengl
%patch2 -p1 -b .generated

%build
export CFLAGS="$RPM_OPT_FLAGS"
export CPPFLAGS="-I/usr/kerberos/include"
autoconf
%configure \
        --sysconfdir=%{_sysconfdir}/wine

%{__make} depend
%{__make}

%install
rm -rf $RPM_BUILD_ROOT

%makeinstall \
        includedir=%{?buildroot:%{buildroot}}%{_includedir}/wine \
        sysconfdir=%{?buildroot:%{buildroot}}%{_sysconfdir}/wine \
        dlldir=%{?buildroot:%{buildroot}}%{_libdir}/wine \
        LDCONFIG=/bin/true \
        UPDATE_DESKTOP_DATABASE=/bin/true
%makeinstall \
        -C dlls/wineps \
        includedir=%{?buildroot:%{buildroot}}%{_includedir}/wine \
        sysconfdir=%{?buildroot:%{buildroot}}%{_sysconfdir}/wine \
        dlldir=%{?buildroot:%{buildroot}}%{_libdir}/wine \
        LDCONFIG=/bin/true \
        UPDATE_DESKTOP_DATABASE=/bin/true

mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/wine
install -c -m 0644 documentation/samples/config $RPM_BUILD_ROOT%{_sysconfdir}/wine/config

cat >RedFlag <<EOF
Wine directory structure used in Red Hat Linux:
===============================================

\${HOME}/.wine/drive_c is the root directory (aka C: drive) wine looks for by
default. It is created with (empty) C:\windows and C:\windows\system
directories, needed to operate Wine without an existing Windows
installation, if it doesn't already exists.

If you want to use Wine with an existing Windows installation that is
mounted, for example, in /mnt/windows-c, change the symlink
\${HOME}/.wine/dosdevices/c: to point to /mnt/windows-c instead of the
defaults set by installation.

If you do this, you can safely remove \${HOME}/.wine_c.
(Alternatively, just mount your Windows partition to \${HOME}/.wine_c.)
EOF

# Allow users to launch Windows programs by just clicking on the .exe file...
mkdir -p $RPM_BUILD_ROOT%{_initrddir}
install -c -m 755 %SOURCE1 $RPM_BUILD_ROOT%{_initrddir}/wine

# Install Wine's fonts
mkdir -p $RPM_BUILD_ROOT%{_datadir}/fonts/wine
tar xzf %SOURCE2 -C $RPM_BUILD_ROOT%{_datadir}/fonts/wine

%clean
rm -rf $RPM_BUILD_ROOT

%post
if ! grep -q "^/usr/lib/wine$" /etc/ld.so.conf; then
        echo "/usr/lib/wine" >>/etc/ld.so.conf
fi
/sbin/ldconfig
/sbin/chkconfig --add wine
/sbin/chkconfig --level 2345 wine on
/sbin/service wine start &>/dev/null || :
if [ "x`which update-desktop-database 2>/dev/null`" != "x" ]; then
        update-desktop-database
fi

%preun
if test "$1" = "0"; then
        /sbin/chkconfig --del wine
fi

%postun
if test "$1" = "0"; then
        perl -pi -e "s,^/usr/lib/wine$,,g" /etc/ld.so.conf
fi
/sbin/ldconfig
if [ "x`which update-desktop-database 2>/dev/null`" != "x" ]; then
        update-desktop-database
fi

%files
%defattr(-,root,root)
%{_bindir}/msiexec
%{_bindir}/notepad
%{_bindir}/progman
%{_bindir}/regedit
%{_bindir}/regsvr32
%{_bindir}/uninstaller
%{_bindir}/wcmd
%{_bindir}/wine
%{_bindir}/wine-kthread
%{_bindir}/wine-preloader
%{_bindir}/wine-pthread
%{_bindir}/wineboot
%{_bindir}/winebrowser
%{_bindir}/winecfg
%{_bindir}/wineconsole
%{_bindir}/winedbg
%{_bindir}/winefile
%{_bindir}/winelauncher
%{_bindir}/winemine
%{_bindir}/winepath
%{_bindir}/wineprefixcreate
%{_bindir}/wineserver
%{_bindir}/wineshelllink
%{_bindir}/winhelp
%{_libdir}/*.so.1
%attr(0755, root, root) %dir %{_libdir}/wine
%{_libdir}/wine/*.so
%{_mandir}/man1/wine.1*
%{_mandir}/man1/winedbg.1*
%{_mandir}/man5/wine.conf.5*
%{_datadir}/aclocal/wine.m4
%{_datadir}/applications/wine.desktop
%attr(0755, root, root) %dir %{_datadir}/fonts/wine
%{_datadir}/fonts/wine/*.fon
%{_datadir}/fonts/wine/*.ttf
%attr(0755, root, root) %dir %{_datadir}/wine
%{_datadir}/wine/generic.ppd
%{_datadir}/wine/wine.inf
%config %{_sysconfdir}/wine
%config %{_initrddir}/wine
%doc ANNOUNCE BUGS COPYING.LIB ChangeLog DEVELOPERS-HINTS LICENSE LICENSE.OLD README VERSION
%doc AUTHORS RedFlag
%doc documentation/ChangeLog.OLD documentation/README.de documentation/README.es documentation/README.fr documentation/README.it documentation/README.pt documentation/README.pt_br
%doc documentation/samples

%files devel
%defattr(-,root,root)
%{_bindir}/function_grep.pl
%{_bindir}/widl
%{_bindir}/winebuild
%{_bindir}/winecpp
%{_bindir}/winedump
%{_bindir}/wineg++
%{_bindir}/winegcc
%{_bindir}/winemaker
%{_bindir}/wmc
%{_bindir}/wrc
%{_libdir}/*.so
%{_mandir}/man1/widl.1*
%{_mandir}/man1/winebuild.1*
%{_mandir}/man1/winedump.1*
%{_mandir}/man1/winegcc.1*
%{_mandir}/man1/winemaker.1*
%{_mandir}/man1/wmc.1*
%{_mandir}/man1/wrc.1*
%attr(0755, root, root) %dir %{_includedir}/wine
%{_includedir}/wine/*
%{_libdir}/wine/*.a
%{_libdir}/wine/*.def[/code:1]

请问 --disable-debug 应该怎么加在这个spec里面?

TOP

%build
export CFLAGS="$RPM_OPT_FLAGS"
export CPPFLAGS="-I/usr/kerberos/include"
autoconf
%configure \
   --sysconfdir=%{_sysconfdir}/wine
在这里吧。但是你用redflag的,我不敢保证正确与否。你要做的确认工作,
1.确认是否是--disable-debug(其实应该我去试试,但是最近功课好多。忙)
2.如果你用的就是redflag也就算了,如果用其他版本就要确认是否能够很好的匹配于自己版本的相关工具,库

TOP

--disable-debug 是对的。我已经测试过了~~thanks

多谢demonlj

我有空就尝试作rpm了
双线1G 空间 180元/年 , 三天试用,365天天退款。QQ:4429491 http://idc.iitop.com 中国第一个wine论坛 http://www.easywine.org 讨论EasyWine和Wine的技术问题!

TOP