Create RPM through MakeFile and Tar ball









up vote
0
down vote

favorite












I am trying to generate RPM using MakeFile, but it fails to work.
Here I show an example



System is CentOs 7



1- I have my application here



/applicationGroup/group01/app01


2- Here is what I have for sake of example



/applicationGroup/group01/app01/public
/applicatoinGroup/group01/app01/lib
/applicationGroup/group01/app01/.git
/applicationGroup/group01/app01/somephp.php
/applicationGroup/group01/app01/MakeFile
/applicationGroup/group01/app01/rpm.spec
/applicationGroup/group01/app01/build


3- Here is what I want to do




  1. 1- setup the MakeFile, so it create the tarball and save it to
    build/SOURCE



    2- the tar ball should exclude : MakeFile, rpm.spec, .git and
    .gitignore



    3- then MakeFile use the rpmbuild to create the rpm



    4- then run: make rpm clean



    5- the generated rpm should be relocatable. That means, i use the
    prefix=/mynewlocation/myappV02, and install it in a new location on
    same machine.



I need the simplest MakeFile and rpm.spec example to achieve above example.
My problem is, when I run the generated rpm, it install it in its original folder location. even though I use the prefix= option.



Name: myAppName 

Version: 1.0.1
Release: 1
Summary: myApp description
License: free
URL: http://myapp.somedomain.com
BuildArch: noarch
Source0: MyappName_V1.0.1.tar.gz
Prefix: /app01
%description
My software Description

%define_missing_doc_files_terminate_build 0

%prep
%autosetup -c package

%build


%install
rm -rf %buildroot
mkdir -p %buildroot
cp -rp * %buildroot

%files
/app01/*


%changelog










share|improve this question























  • Have you tried to read any manual about relocatable rpms? I googled this: rpm5.org/docs/api/relocatable.html Additionally: I understand you already have some spec file. Can you share it here? By the way: why you want to use makefile?
    – Kuchara
    Nov 10 at 15:45











  • I need to use MakeFile to automate the deployment process. as one single step for developers to create the rpm and one step for DevOp to install the rpm. There is more into this, this is just part of the solution. Docker and git CI/DI is part of it. By the way, i don't have the spec file handy now.
    – user3534653
    Nov 10 at 16:17











  • ok, i found the spec, included above
    – user3534653
    Nov 10 at 16:31










  • You can't do anything with Make until you know how to do i without Make. You must figure out how to build a satisfactory rpm on the command line, before you worry about writing a Makefile.
    – Beta
    Nov 11 at 0:41














up vote
0
down vote

favorite












I am trying to generate RPM using MakeFile, but it fails to work.
Here I show an example



System is CentOs 7



1- I have my application here



/applicationGroup/group01/app01


2- Here is what I have for sake of example



/applicationGroup/group01/app01/public
/applicatoinGroup/group01/app01/lib
/applicationGroup/group01/app01/.git
/applicationGroup/group01/app01/somephp.php
/applicationGroup/group01/app01/MakeFile
/applicationGroup/group01/app01/rpm.spec
/applicationGroup/group01/app01/build


3- Here is what I want to do




  1. 1- setup the MakeFile, so it create the tarball and save it to
    build/SOURCE



    2- the tar ball should exclude : MakeFile, rpm.spec, .git and
    .gitignore



    3- then MakeFile use the rpmbuild to create the rpm



    4- then run: make rpm clean



    5- the generated rpm should be relocatable. That means, i use the
    prefix=/mynewlocation/myappV02, and install it in a new location on
    same machine.



I need the simplest MakeFile and rpm.spec example to achieve above example.
My problem is, when I run the generated rpm, it install it in its original folder location. even though I use the prefix= option.



Name: myAppName 

Version: 1.0.1
Release: 1
Summary: myApp description
License: free
URL: http://myapp.somedomain.com
BuildArch: noarch
Source0: MyappName_V1.0.1.tar.gz
Prefix: /app01
%description
My software Description

%define_missing_doc_files_terminate_build 0

%prep
%autosetup -c package

%build


%install
rm -rf %buildroot
mkdir -p %buildroot
cp -rp * %buildroot

%files
/app01/*


%changelog










share|improve this question























  • Have you tried to read any manual about relocatable rpms? I googled this: rpm5.org/docs/api/relocatable.html Additionally: I understand you already have some spec file. Can you share it here? By the way: why you want to use makefile?
    – Kuchara
    Nov 10 at 15:45











  • I need to use MakeFile to automate the deployment process. as one single step for developers to create the rpm and one step for DevOp to install the rpm. There is more into this, this is just part of the solution. Docker and git CI/DI is part of it. By the way, i don't have the spec file handy now.
    – user3534653
    Nov 10 at 16:17











  • ok, i found the spec, included above
    – user3534653
    Nov 10 at 16:31










  • You can't do anything with Make until you know how to do i without Make. You must figure out how to build a satisfactory rpm on the command line, before you worry about writing a Makefile.
    – Beta
    Nov 11 at 0:41












up vote
0
down vote

favorite









up vote
0
down vote

favorite











I am trying to generate RPM using MakeFile, but it fails to work.
Here I show an example



System is CentOs 7



1- I have my application here



/applicationGroup/group01/app01


2- Here is what I have for sake of example



/applicationGroup/group01/app01/public
/applicatoinGroup/group01/app01/lib
/applicationGroup/group01/app01/.git
/applicationGroup/group01/app01/somephp.php
/applicationGroup/group01/app01/MakeFile
/applicationGroup/group01/app01/rpm.spec
/applicationGroup/group01/app01/build


3- Here is what I want to do




  1. 1- setup the MakeFile, so it create the tarball and save it to
    build/SOURCE



    2- the tar ball should exclude : MakeFile, rpm.spec, .git and
    .gitignore



    3- then MakeFile use the rpmbuild to create the rpm



    4- then run: make rpm clean



    5- the generated rpm should be relocatable. That means, i use the
    prefix=/mynewlocation/myappV02, and install it in a new location on
    same machine.



I need the simplest MakeFile and rpm.spec example to achieve above example.
My problem is, when I run the generated rpm, it install it in its original folder location. even though I use the prefix= option.



Name: myAppName 

Version: 1.0.1
Release: 1
Summary: myApp description
License: free
URL: http://myapp.somedomain.com
BuildArch: noarch
Source0: MyappName_V1.0.1.tar.gz
Prefix: /app01
%description
My software Description

%define_missing_doc_files_terminate_build 0

%prep
%autosetup -c package

%build


%install
rm -rf %buildroot
mkdir -p %buildroot
cp -rp * %buildroot

%files
/app01/*


%changelog










share|improve this question















I am trying to generate RPM using MakeFile, but it fails to work.
Here I show an example



System is CentOs 7



1- I have my application here



/applicationGroup/group01/app01


2- Here is what I have for sake of example



/applicationGroup/group01/app01/public
/applicatoinGroup/group01/app01/lib
/applicationGroup/group01/app01/.git
/applicationGroup/group01/app01/somephp.php
/applicationGroup/group01/app01/MakeFile
/applicationGroup/group01/app01/rpm.spec
/applicationGroup/group01/app01/build


3- Here is what I want to do




  1. 1- setup the MakeFile, so it create the tarball and save it to
    build/SOURCE



    2- the tar ball should exclude : MakeFile, rpm.spec, .git and
    .gitignore



    3- then MakeFile use the rpmbuild to create the rpm



    4- then run: make rpm clean



    5- the generated rpm should be relocatable. That means, i use the
    prefix=/mynewlocation/myappV02, and install it in a new location on
    same machine.



I need the simplest MakeFile and rpm.spec example to achieve above example.
My problem is, when I run the generated rpm, it install it in its original folder location. even though I use the prefix= option.



Name: myAppName 

Version: 1.0.1
Release: 1
Summary: myApp description
License: free
URL: http://myapp.somedomain.com
BuildArch: noarch
Source0: MyappName_V1.0.1.tar.gz
Prefix: /app01
%description
My software Description

%define_missing_doc_files_terminate_build 0

%prep
%autosetup -c package

%build


%install
rm -rf %buildroot
mkdir -p %buildroot
cp -rp * %buildroot

%files
/app01/*


%changelog







git makefile tar rpm






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 10 at 16:30

























asked Nov 10 at 15:10









user3534653

9112




9112











  • Have you tried to read any manual about relocatable rpms? I googled this: rpm5.org/docs/api/relocatable.html Additionally: I understand you already have some spec file. Can you share it here? By the way: why you want to use makefile?
    – Kuchara
    Nov 10 at 15:45











  • I need to use MakeFile to automate the deployment process. as one single step for developers to create the rpm and one step for DevOp to install the rpm. There is more into this, this is just part of the solution. Docker and git CI/DI is part of it. By the way, i don't have the spec file handy now.
    – user3534653
    Nov 10 at 16:17











  • ok, i found the spec, included above
    – user3534653
    Nov 10 at 16:31










  • You can't do anything with Make until you know how to do i without Make. You must figure out how to build a satisfactory rpm on the command line, before you worry about writing a Makefile.
    – Beta
    Nov 11 at 0:41
















  • Have you tried to read any manual about relocatable rpms? I googled this: rpm5.org/docs/api/relocatable.html Additionally: I understand you already have some spec file. Can you share it here? By the way: why you want to use makefile?
    – Kuchara
    Nov 10 at 15:45











  • I need to use MakeFile to automate the deployment process. as one single step for developers to create the rpm and one step for DevOp to install the rpm. There is more into this, this is just part of the solution. Docker and git CI/DI is part of it. By the way, i don't have the spec file handy now.
    – user3534653
    Nov 10 at 16:17











  • ok, i found the spec, included above
    – user3534653
    Nov 10 at 16:31










  • You can't do anything with Make until you know how to do i without Make. You must figure out how to build a satisfactory rpm on the command line, before you worry about writing a Makefile.
    – Beta
    Nov 11 at 0:41















Have you tried to read any manual about relocatable rpms? I googled this: rpm5.org/docs/api/relocatable.html Additionally: I understand you already have some spec file. Can you share it here? By the way: why you want to use makefile?
– Kuchara
Nov 10 at 15:45





Have you tried to read any manual about relocatable rpms? I googled this: rpm5.org/docs/api/relocatable.html Additionally: I understand you already have some spec file. Can you share it here? By the way: why you want to use makefile?
– Kuchara
Nov 10 at 15:45













I need to use MakeFile to automate the deployment process. as one single step for developers to create the rpm and one step for DevOp to install the rpm. There is more into this, this is just part of the solution. Docker and git CI/DI is part of it. By the way, i don't have the spec file handy now.
– user3534653
Nov 10 at 16:17





I need to use MakeFile to automate the deployment process. as one single step for developers to create the rpm and one step for DevOp to install the rpm. There is more into this, this is just part of the solution. Docker and git CI/DI is part of it. By the way, i don't have the spec file handy now.
– user3534653
Nov 10 at 16:17













ok, i found the spec, included above
– user3534653
Nov 10 at 16:31




ok, i found the spec, included above
– user3534653
Nov 10 at 16:31












You can't do anything with Make until you know how to do i without Make. You must figure out how to build a satisfactory rpm on the command line, before you worry about writing a Makefile.
– Beta
Nov 11 at 0:41




You can't do anything with Make until you know how to do i without Make. You must figure out how to build a satisfactory rpm on the command line, before you worry about writing a Makefile.
– Beta
Nov 11 at 0:41

















active

oldest

votes











Your Answer






StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");

StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53240266%2fcreate-rpm-through-makefile-and-tar-ball%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown






























active

oldest

votes













active

oldest

votes









active

oldest

votes






active

oldest

votes















draft saved

draft discarded
















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.





Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


Please pay close attention to the following guidance:


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53240266%2fcreate-rpm-through-makefile-and-tar-ball%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Use pre created SQLite database for Android project in kotlin

Darth Vader #20

Ondo