Fedora Linux Support Community & Resources Center
  #16  
Old 4th May 2017, 12:39 AM
PabloTwo Offline
"Registered User" T-Shirt Winner
 
Join Date: Mar 2007
Location: Seville, FL
Posts: 7,562
linuxchrome
Re: Is there a guide to convert arch's PKGBUILD to RPM packages?

I twiddled my spec file until it successfully compiled and built the package(s), which brought it back very close to what your original spec file was. The compile error was due to me using just "%make_build" alone, without the "-j1" directive. Because %make_build by itself resolves to,
Code:
$ rpm -E %make_build
/usr/bin/make -O -j4
Well, this code can't cope with multi-thread compiling, or so it would seem. So you figured out everything that had to be done to make this work.
Reply With Quote
  #17  
Old 4th May 2017, 12:01 PM
ThanosApostolou Offline
Registered User
 
Join Date: Nov 2016
Location: Athens, Greece
Posts: 17
linuxfedorafirefox
Re: Is there a guide to convert arch's PKGBUILD to RPM packages?

I've successfully build now all otcl, tclcl, ns, nam. I used ./configure instead of %configure and --enable-static to all of them except for the nam, similar to how it's done in AUR, because otherwise I was running into libraries problems. Also I used install commands instead of %make_install because as you said its install script is kinda broken. I will upload the final specs on my github in order to see them.

I'm trying to package the xgraph which has a pre-compiled source. The thing is that I need to use different source for i386 and different source for x86-64 the same way i have done it in the AUR (https://aur.archlinux.org/cgit/aur.g...D?h=xgraph-bin). Arch's pkgbuild can use source_i686 and source_x86_64 but I cannot find anything equivalent for RPM. So how do I do that?
Reply With Quote
  #18  
Old 4th May 2017, 12:57 PM
ThanosApostolou Offline
Registered User
 
Join Date: Nov 2016
Location: Athens, Greece
Posts: 17
linuxfedorafirefox
Re: Is there a guide to convert arch's PKGBUILD to RPM packages?

Ok I've done some tricks and now I have successfully build them all. You can see the spec files and the sources at the new github repository: https://github.com/ThanosApostolou/o...ns2-nam-xgraph (I have included all the sources so that if you clone this repository you should be able to build them right away if you want to test them).

I will try to build them with mock too in order to find which dependencies are really needed for each, because it's hard to do that in my local system.

If you have time to check them and find any improvements then please tell me, because I will probably try to create a copr repository in the future and I want the spec files to be in good quality for fedora standards.

Anyway, for now I can do my university's projects:
Reply With Quote
  #19  
Old 4th May 2017, 03:03 PM
antikythera Offline
Administrator
 
Join Date: Dec 2013
Location: United Kingdom
Posts: 5,073
linuxchrome
Re: Is there a guide to convert arch's PKGBUILD to RPM packages?

kudos and thanks for sharing the github link
__________________
Download, Install and Share Fedora - Official ISO Torrents | Live ISO Respins containing post-release updates
Reply With Quote
  #20  
Old 4th May 2017, 06:24 PM
PabloTwo Offline
"Registered User" T-Shirt Winner
 
Join Date: Mar 2007
Location: Seville, FL
Posts: 7,562
linuxchrome
Re: Is there a guide to convert arch's PKGBUILD to RPM packages?

Just a suggestion on how you can simplify your spec file for tclcl (and others also).
Original:
Code:
%install
install -Dm755 tcl2c++ %{buildroot}/%{_bindir}/tcl2c++
install -Dm644 config.h %{buildroot}/%{_includedir}/config.h
install -Dm644 idlecallback.h %{buildroot}/%{_includedir}/idlecallback.h
install -Dm644 iohandler.h %{buildroot}/%{_includedir}/iohandler.h
install -Dm644 rate-variable.h %{buildroot}/%{_includedir}/rate-variable.h
install -Dm644 tclcl-config.h %{buildroot}/%{_includedir}/tclcl-config.h
install -Dm644 tclcl-internal.h %{buildroot}/%{_includedir}/tclcl-internal.h
install -Dm644 tclcl-mappings.h %{buildroot}/%{_includedir}/tclcl-mappings.h
install -Dm644 tclcl.h %{buildroot}/%{_includedir}/tclcl.h
install -Dm644 timer.h %{buildroot}/%{_includedir}/timer.h
install -Dm644 tracedvar.h %{buildroot}/%{_includedir}/tracedvar.h
install -Dm644 libtclcl.a %{buildroot}/%{_libdir}/libtclcl.a

%files
%{_includedir}/config.h
%{_includedir}/idlecallback.h
%{_includedir}/iohandler.h
%{_includedir}/rate-variable.h
%{_includedir}/tclcl-config.h
%{_includedir}/tclcl-internal.h
%{_includedir}/tclcl-mappings.h
%{_includedir}/tclcl.h
%{_includedir}/timer.h
%{_includedir}/tracedvar.h
%{_libdir}/libtclcl.a
Simplified:
Code:
%install
install -Dm755 tcl2c++ %{buildroot}/%{_bindir}
install -Dm644 config.h idlecallback.h iohandler.h rate-variable.h tclcl-config.h \
tclcl-internal.h tclcl-mappings.h tclcl.h timer.h tracedvar.h %{buildroot}/%{_includedir}
install -Dm644 libtclcl.a %{buildroot}/%{_libdir}

%files
%{_bindir}/tcl2c++
%{_includedir}/*.h
%{_libdir}/libtclcl.a
No need to repeat the file name in the target directory if the name is not being changed. Use of *glob* in the %files section is OK. Sure makes for a lot less typing.

Last edited by PabloTwo; 4th May 2017 at 09:54 PM. Reason: Missed one header file
Reply With Quote
  #21  
Old 5th May 2017, 11:27 AM
ThanosApostolou Offline
Registered User
 
Join Date: Nov 2016
Location: Athens, Greece
Posts: 17
linuxfedorafirefox
Re: Is there a guide to convert arch's PKGBUILD to RPM packages?

Thx for the tips, I will try to apply them in any other packages I will make in the future.

After many tries, I have successfully created a copr repository (it's harder than it seems...) https://copr.fedorainfracloud.org/co...s2-nam-xgraph/

I made some changes in order to make the packages work properly, so I will delete the github repository. If anyone wants to, the src.rpm files can be downloaded from the copr repository.

I will mark this as SOLVED. Nevertheless, it would be a great idea, if someone has enough experience and time available, to create a good tutorial/guide for PKGUBILD -> RPM and AUR -> COPR comparisons in order to help former arch users with the transition. The fedora documentation isn't complete or "smart enough" in my opinion. I will definitely miss the arch wiki which can cover 99% of cases in anything you search with just 2 pages of documentation.
Reply With Quote
Reply

Tags
arch, convert, guide, packages, pkgbuild, rpm

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] packages with multiple arch installed on my system... tracubo Installation, Upgrades and Live Media 2 2nd February 2015 03:34 PM
Arch BSD: Arch Linux Atop The FreeBSD Kernel Wayne Linux Chat 4 27th January 2013 06:16 AM
how to convert deb packages to rpm justwarm Using Fedora 5 28th June 2010 08:20 PM
dual boot F9/Arch - Arch fails FS check on F9 partition daneel971 Linux Chat 0 29th May 2008 02:51 PM
The easy guide to media installation - No Arch K1u Guides & Solutions (Not For Questions) 1 12th October 2007 04:20 AM


Current GMT-time: 21:45 (Wednesday, 20-09-2017)

TopSubscribe to XML RSS for all Threads in all ForumsFedoraForumDotOrg Archive
logo

All trademarks, and forum posts in this site are property of their respective owner(s).
FedoraForum.org is privately owned and is not directly sponsored by the Fedora Project or Red Hat, Inc.

Privacy Policy | Term of Use | Posting Guidelines | Archive | Contact Us | Founding Members

Powered by vBulletin® Copyright ©2000 - 2012, vBulletin Solutions, Inc.

FedoraForum is Powered by RedHat