Fedora Linux Support Community & Resources Center
  #1  
Old 11th March 2017, 05:12 PM
Phoenix76 Offline
Registered User
 
Join Date: Jan 2017
Location: GNOME Shell
Posts: 10
linuxfedoraepiphany
Question How to create an RPM

Currently this https://www.youtube.com/watch?v=9sWndAoYnEI is how i install Networx on Fedora Workstation however i prefer if i could make an RPM for personal use.

Thank you in advance.
Reply With Quote
  #2  
Old 12th March 2017, 04:11 AM
ocratato Online
Registered User
 
Join Date: Oct 2010
Location: Canberra
Posts: 2,498
linuxfirefox
Re: How to create an RPM

There is a program called alien that can convert .deb into .rpm (and reverse)
__________________
Has anyone seriously considered that it might be turtles all the way down?
That's very old fashioned thinking.
The current model is that it's holographic nested virtualities of turtles, all the way down.
Reply With Quote
  #3  
Old 12th March 2017, 10:49 PM
User808 Offline
Registered User
 
Join Date: Aug 2016
Location: Iraq
Posts: 532
linuxfedorafirefox
Re: How to create an RPM

Quote:
Originally Posted by ocratato View Post
There is a program called alien that can convert .deb into .rpm (and reverse)
Thank you very much for this ! There are many .deb packages not available as .rpm

But I would like to ask about safety of this program in conversion. I mean, for my knowlage, .rpm for openSUZE my break Fedora & those for Fedora may break openSUSE. Is this program contain options to make .rpm packages specific for specific distros ? Is there a risk from it's use from this point of view?
__________________
Fedora 24 X64 bit Cinnamon edition on Lenovo ThinkPad e550 with Intel core i7 5500 CPU @ 2.40 GH X 2, RAM = 8 GB, HHD = 1 TB, Hybrid VGA (Intel Corporation HD Graphic 5500 + Radeon R7 M265 2GB)
Reply With Quote
  #4  
Old 12th March 2017, 10:56 PM
antikythera Offline
Administrator
 
Join Date: Dec 2013
Location: United Kingdom
Posts: 4,037
linuxchrome
Re: How to create an RPM

Quote:
Originally Posted by User808 View Post
Thank you very much for this ! There are many .deb packages not available as .rpm

But I would like to ask about safety of this program in conversion. I mean, for my knowlage, .rpm for openSUZE my break Fedora & those for Fedora may break openSUSE. Is this program contain options to make .rpm packages specific for specific distros ? Is there a risk from it's use from this point of view?
yes there is an inherent risk of using this program to convert from deb to rpm. the conversion is not guaranteed to work.
__________________
Download, Install and Share Fedora - Official ISO Torrents | Live ISO Respins containing post-release updates
Reply With Quote
  #5  
Old 13th March 2017, 01:55 PM
nonamedotc Offline
Mithrandir
 
Join Date: Mar 2011
Location: /
Posts: 4,947
windows_7chrome
Re: How to create an RPM

In my experience, alien is reasonably useful to convert *.deb to *.rpm with one MAJOR caveat.

In almost all cases that I have seen, a rpm created from deb seem to have one strange issue. It will want to "own" the /, /usr, /usr/{bin,lib}, etc. This is not necessarily good. The good part is that this is easily fixed.

So, in practice (at least in my experience), alien conversion is a two step process.

Step 1:

Code:
alien -r my_fancy_program.deb
Step 2:

Fix the issues in the generated rpm using rpmrebuild

Code:
rpmrebuild -ep my_fancy_program.rpm
*** YMMV ***
__________________
Fedora 24 x86_64 XFCE - Sager | Intel Core i7 - 4810 MQ | NVIDIA GeForce GTX 860M | 16 GB RAM | 480 GB ADATA SSD |
CentOS 7.2.1511 x86_64 Server - Thinkpad T520 | Intel Core i7 - 2630 QM | NVIDIA NVS 4200M | 16 GB RAM | 500 GB 7200 RPM HDD |


The Linux Documentation Project | Fedora Documentation
Reply With Quote
  #6  
Old 13th March 2017, 11:11 PM
User808 Offline
Registered User
 
Join Date: Aug 2016
Location: Iraq
Posts: 532
linuxfedorafirefox
Re: How to create an RPM

Quote:
Originally Posted by nonamedotc View Post
In my experience, alien is reasonably useful to convert *.deb to *.rpm with one MAJOR caveat.

In almost all cases that I have seen, a rpm created from deb seem to have one strange issue. It will want to "own" the /, /usr, /usr/{bin,lib}, etc. This is not necessarily good. The good part is that this is easily fixed.

So, in practice (at least in my experience), alien conversion is a two step process.

Step 1:

Code:
alien -r my_fancy_program.deb
Step 2:

Fix the issues in the generated rpm using rpmrebuild

Code:
rpmrebuild -ep my_fancy_program.rpm
*** YMMV ***
Does these commands need "sudo" or not ?
__________________
Fedora 24 X64 bit Cinnamon edition on Lenovo ThinkPad e550 with Intel core i7 5500 CPU @ 2.40 GH X 2, RAM = 8 GB, HHD = 1 TB, Hybrid VGA (Intel Corporation HD Graphic 5500 + Radeon R7 M265 2GB)
Reply With Quote
  #7  
Old 14th March 2017, 12:31 AM
PabloTwo Offline
"Registered User" T-Shirt Winner
 
Join Date: Mar 2007
Location: Seville, FL
Posts: 7,526
linuxchrome
Re: How to create an RPM

Quote:
Originally Posted by User808
Does these commands need "sudo" or not ?
No. But what nonamedtoc failed to point out is that the command rpmrebuild -ep my_fancy_program.rpm in itself does nothing to fix any problems by itself. It merely reconstructs a spec file for the package, which it presents to you to edit yourself to fix the issue(s). If you don't know anything about rpm packaging and spec files, then it's of no use to you as you wouldn't have a clue what to edit.

At the very least, you need to have at least a rudimentary understanding of an rpm package spec file before initiating an rpmrebuild -ep <package> command. Better yet, take the time (weeks/months/years) to actually learn rpm package building. There is no magic button to create rpm packages.
Reply With Quote
  #8  
Old 14th March 2017, 12:50 AM
nonamedotc Offline
Mithrandir
 
Join Date: Mar 2011
Location: /
Posts: 4,947
linuxchrome
Re: How to create an RPM

well, the -e flag explicitly stands for --edit-spec ... meaning, edit the spec file before proceeding.
__________________
Fedora 24 x86_64 XFCE - Sager | Intel Core i7 - 4810 MQ | NVIDIA GeForce GTX 860M | 16 GB RAM | 480 GB ADATA SSD |
CentOS 7.2.1511 x86_64 Server - Thinkpad T520 | Intel Core i7 - 2630 QM | NVIDIA NVS 4200M | 16 GB RAM | 500 GB 7200 RPM HDD |


The Linux Documentation Project | Fedora Documentation
Reply With Quote
  #9  
Old 14th March 2017, 12:55 AM
PabloTwo Offline
"Registered User" T-Shirt Winner
 
Join Date: Mar 2007
Location: Seville, FL
Posts: 7,526
linuxchrome
Re: How to create an RPM

Quote:
Originally Posted by nonamedotc View Post
well, the -e flag explicitly stands for --edit-spec ... meaning, edit the spec file before proceeding.
Yes, you and I already know that. My comment here was aimed at the uninformed who might construe that that command alone, without any further user intervention, would make the world right.
Reply With Quote
  #10  
Old 15th March 2017, 12:38 AM
Phoenix76 Offline
Registered User
 
Join Date: Jan 2017
Location: GNOME Shell
Posts: 10
linuxfedoraepiphany
Re: How to create an RPM

Thank you for your replies.

I more interested in building the RPM the Fedora way using only the etc & usr data contained in the data.tar.xz portion of the deb package with out relying on conversion or even the deb file.

I want to use the etc and usr data as input and output an RPM package the Fedora/RHEL way

If anyone is familiar with building RPM packages that can walk me though the process using the contents of the Networx deb package i'll appreciate it a lot.

Thank you in advance.
Reply With Quote
  #11  
Old 15th March 2017, 12:59 AM
PabloTwo Offline
"Registered User" T-Shirt Winner
 
Join Date: Mar 2007
Location: Seville, FL
Posts: 7,526
windows_8firefox
Re: How to create an RPM

https://fedoraproject.org/wiki/How_t...an_RPM_package

https://docs.fedoraproject.org/en-US...ckagers_Guide/

Walk you through? No, it's too long of a walk.
Reply With Quote
  #12  
Old 16th March 2017, 07:36 AM
Phoenix76 Offline
Registered User
 
Join Date: Jan 2017
Location: GNOME Shell
Posts: 10
linuxfedoraepiphany
Re: How to create an RPM

@PabloTwo

Of course i am familiar with such documentation, What i want if someone is willing is to make an RPM of Networx and post a screen cast or a walk-through so that all of us who are interested in this kind of a thing to have an actual use case scenario that we can follow and replicate instead of way too long cryptic jargon.

I want to watch it being done. As in the video i have posted.

Thanks anyway
Reply With Quote
  #13  
Old 17th March 2017, 01:18 PM
RahulSundaram Offline
Registered User
 
Join Date: May 2005
Posts: 3,868
linuxfedorachrome
Re: How to create an RPM

Hi

You should be able to get started with something really simple

https://fedoraproject.org/wiki/How_t...lo_RPM_package
__________________
Rahul
http://fedoraproject.org/wiki/RahulSundaram
Reply With Quote
  #14  
Old 17th March 2017, 10:31 PM
srakitnican Offline
Registered User
 
Join Date: Oct 2011
Posts: 1,288
linuxchrome
Re: How to create an RPM

Since this is a specific case of repackaging existing binaries, I am posting you a solution. Follow tutorial to create rpmbuild tree and then populate SPECS directory with following spec file, and SOURCES with .deb official package. After that run rpmbuild.

Code:
%global __os_install_post %{nil}

Name:		networx
Version:	1.0.3
Release:	1
Summary:	Network monitor and statistics

Group:		Applications/System
License:	Commercial
URL:		https://www.softperfect.com/products/networx
Source0:	https://www.softperfect.com/download/files/networx_linux_amd64.deb

#BuildRequires:	
#Requires:	

%description
A versatile and powerful utility that provides an accurate account of the data
flowing through your computer’s network connection; it features usage reports,
notifications and various network tools.


%prep
rm -rf %{_builddir}/%{name}-%{version}
mkdir %{_builddir}/%{name}-%{version}
cd %{_builddir}/%{name}-%{version}
ar ox %{_sourcedir}/networx_linux_amd64.deb
xz -dc data.tar.xz | tar -xof -


%install
cd %{_builddir}/%{name}-%{version}
cp -rp etc usr %{buildroot}/


%files
%config %{_sysconfdir}/xdg/autostart/*
%{_bindir}/*
%{_datadir}/applications/%{name}.desktop
%{_datadir}/pixmaps/%{name}.png


%changelog
* Fri Mar 17 2017 srakitnican <srakitnican@fedoraproject.org> 1.0.3-1
- Initial build

Don't expect such package included in Fedora, though.

Last edited by srakitnican; 18th March 2017 at 12:30 AM. Reason: No need for %{?dist} in re-package
Reply With Quote
  #15  
Old 18th March 2017, 12:26 AM
Phoenix76 Offline
Registered User
 
Join Date: Jan 2017
Location: GNOME Shell
Posts: 10
linuxfedoraepiphany
Re: How to create an RPM

Thank you very much srakitnican, I'll try that
Reply With Quote
Reply

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
How to create? Neill Programming & Packaging 8 16th September 2014 03:42 AM
what to use to create RPM? hidepenny Using Fedora 4 2nd May 2007 03:31 AM


Current GMT-time: 05:07 (Tuesday, 23-05-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