2
0
I built for the first time a RPM package. This RPM is a packaged front-end app, and the install only needs to move the app files and do a nginx restart. This is my spec file:
Name: my-portal-app
Version: 2.1
Release: 1%{?dist}
Summary: Descripcion
License: No-license
URL: nourl
Source0: my-portal-app-2.1.tar.gz
%description
My app install
%prep
%setup -q
%build
#%configure
#make %{?_smp_mflags}
%install
#rm -rf $RPM_BUILD_ROOT
cp -r ./* /var/www/myapp
service nginx restart
%clean
rm -rf $RPM_BUILD_ROOT
%files
%defattr(-,root,root,-)
%doc
%changelog
All it's ok when i run rpmbuild -ba, exit 0, and the %install sequence is computed (copy files and restart nginx). Ok, rpmbuild generates the RPM (in rpmbuild/RPMS) and the SRPM in (rpmbuild/SRPMS).
But, if i understand well, when i install my SRPM with rpm -ivh name.rpm the %install sequence must be executed, am i right? If i am, sequence is not being executed (not copy files to /var/www/myapp and not restarting nginx). Executing the RPM the same.
The contain of the SRPM is correct, all files are in. And the RPM is empty.
The correct section to accomplish my goal is %post – Kalamarico – 2017-08-30T12:54:28.303