How to install rpmdev tools on ubuntu?
Asked Answered
S

1

9

I am creating my first package using RPM on ubuntu machine.But I am getting so many difficulties.I tried so many commands to install rpmdevtools using "yum" but it is giving error as There are not repos enabled. When I try to install it using apt-get it gives error as Unable to locate the package.

Can anybody suggest the proper start to end procedure with commands to build a package using RPM?

Sandglass answered 9/12, 2019 at 11:43 Comment(0)
B
22

rpmdev is mostly optional. rpm is enough. The following describes the minimum steps to package a script program into a RPM file on Debian.

Install rpmbuild:

apt-get install rpm

Create a helloworld program:

cat > helloworld <<EOF
#! /bin/bash
printf "Hello World!\n"
EOF
chmod +x helloworld

Create a minimal specification helloworld.spec:

Name:       helloworld
Version:    1.0
Release:    1%{?dist}
Summary:    Hello World
License:    GPLv3+
BuildArch:  noarch

%description
Hello World!

%prep

%build

%install
mkdir -p %{buildroot}/%{_bindir}
install -m 0755 %{name} %{buildroot}/%{_bindir}/%{name}

%files
%{_bindir}/%{name}

%changelog

Build the RPMs:

rpmbuild -ba --build-in-place --define "_topdir $(pwd)/rpm" helloworld.spec
mv rpm/SRPMS/*.rpm .
mv rpm/RPMS/*/*.rpm .
rm -rf rpm

But you will not be able to install it on Debian or Ubuntu. The installation requires Fedora or Red Hat.

Barbiebarbieri answered 25/11, 2020 at 15:22 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.