Here is a problem:
- I need to install package in CentOS 7 (let's call it "testpack") from my own rpm-package. Thanks to guys from Stackoverflow, I know that I need to install this testpack from "Requires" section of .spec file, but the testpack need to be installed from non-default repository.
Here is a question:
- How can I add non-default repository within .spec file which has a string "Requires: testpack"? Adding new repository and installing testpack need to do from the same package. Is it possible?
Here is my strange pre-solutions:
- try to add string like that
curl http://domain.com/testpack_repo.sh | bash /dev/stdin arg1in%preand%prepsection of .spec file, but that section is launch only while rpm is making withrpmbuild --bb test.spec. If I try to install this package in other system withyum install test.rpmthis section is ignored; - try to add
curl http://domain.com/testpack_repo.sh | bash /dev/stdin arg1in%postsection without hope. This section is ignored duringyum install test.rpmbecause of testpack installing from "Requires" were failed; - try to use bash script with curl instead naked curl - got the same result;
- try to use
echo repo_info > repo_filein different section of .spec file - failed again.
Here is my .spec file:
Name: test_script_name
Summary: It's just a test_script_summary
Version: 0.1
Release: 1
Group: Applications/Internet
License: GPL
Requires: testpack
BuildArch: noarch
BuildRoot: %{_tmppath}/%{name}-root
%description
A test_script_description.
%pre
curl http://domain.com/test.sh | bash /dev/stdin arg1
%prep
%build
%install
%clean
%post
#bash test.sh
%files
%defattr(-,root,root)
%changelog
* Tue Dec 08 2015 test test <[email protected]>
- test_script_changelog!
I hope for help. Thank you.