From b4a131eb9aafadee79475bf63fa27e8d7dc9333a Mon Sep 17 00:00:00 2001 From: T.C. Hollingsworth Date: Aug 27 2013 12:17:41 +0000 Subject: merge history from draft packaging --- diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..17597ed --- /dev/null +++ b/LICENSE @@ -0,0 +1,19 @@ +Copyright 2013 T.C. Hollingsworth + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to +deal in the Software without restriction, including without limitation the +rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +sell copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +IN THE SOFTWARE. diff --git a/README.devel b/README.devel new file mode 100644 index 0000000..b281843 --- /dev/null +++ b/README.devel @@ -0,0 +1,8 @@ +web-assets-devel contains the RPM macros that implement the Fedora Web Assets +and JavaScript packaging policies. + +For more information on packaging Web Assets, see: +https://fedoraproject.org/wiki/Packaging:Web_Assets + +For more information on packaging JavaScript, see: +https://fedoraproject.org/wiki/Packaging:JavaScript diff --git a/README.md b/README.md new file mode 100644 index 0000000..3a3e587 --- /dev/null +++ b/README.md @@ -0,0 +1,19 @@ +one directory to rule them all +============================== + +For more information, see the +[proposal](https://fedoraproject.org/Changes/Web_Assets) and +[proposed guidelines](https://fedoraproject.org/User:Patches/PackagingDrafts/Web_Assets) + +Try Me +------ + +```sh +sudo yum install git fedora-packager +git clone https://github.com/tchollingsworth/fedora-web-assets +cd fedora-web-assets +fedpkg --dist=f19 local +sudo yum install noarch/* +``` + +[There are also some builds here.](http://patches.fedorapeople.org/web-assets/) diff --git a/macros.web-assets b/macros.web-assets new file mode 100644 index 0000000..48ca9f9 --- /dev/null +++ b/macros.web-assets @@ -0,0 +1,13 @@ +%_webassetdir %{_datadir}/web-assets +%_jsdir %{_datadir}/javascript + +%js_includes() %{expand: \ +%( + ver=$(rpm -q --qf='%%{version}' -- %1) + if [[ $? -eq 0 ]]; then + echo "Provides: js-includes(%1) = $ver" + else + echo "Provides: js-includes(%1)" + fi +) +} diff --git a/web-assets.conf b/web-assets.conf new file mode 100644 index 0000000..4fa3719 --- /dev/null +++ b/web-assets.conf @@ -0,0 +1,14 @@ +Alias /_sysassets /usr/share/web-assets + + + Options -Indexes + Require all granted + + +Alias /_sysassets/javascript /usr/share/javascript +Alias /_sysassets/js /usr/share/javascript + + + Options -Indexes + Require all granted + diff --git a/web-assets.spec b/web-assets.spec new file mode 100644 index 0000000..a64925d --- /dev/null +++ b/web-assets.spec @@ -0,0 +1,113 @@ +#disable the httpd stuff while we're waiting on getting the path issues +#cleared up +%global enable_httpd 0 + +Name: web-assets +Version: 4 +Release: 2%{?dist} +Summary: A simple framework for bits pushed to browsers +BuildArch: noarch + +License: MIT +URL: https://fedoraproject.org/wiki/User:Patches/PackagingDrafts/Web_Assets + +Source1: LICENSE +Source2: macros.web-assets +Source3: web-assets.conf +Source4: README.devel + +%description +%{summary}. + +%package filesystem +Summary: The basic directory layout for Web Assets +#there's nothing copyrightable about a few directories and symlinks +License: Public Domain + +%description filesystem +%{summary}. + +%package devel +Summary: RPM macros for Web Assets packaging +License: MIT +Requires: web-assets-filesystem = %{version}-%{release} + +%description devel +%{summary}. + +%if 0%{?enable_httpd} +%package httpd +Summary: Web Assets aliases for the Apache HTTP daemon +License: MIT +Requires: web-assets-filesystem = %{version}-%{release} +Requires: httpd +Requires(post): systemd +Requires(postun): systemd + +%description httpd +%{summary}. +%endif + +%prep +%setup -c -T +cp %{SOURCE1} LICENSE +cp %{SOURCE4} README.devel + +%build +#nothing to do + +%install +mkdir -p %{buildroot}%{_datadir}/web-assets +mkdir -p %{buildroot}%{_datadir}/javascript + +ln -sf ../javascript %{buildroot}%{_datadir}/web-assets/javascript +ln -sf ../javascript %{buildroot}%{_datadir}/web-assets/js +ln -sf ../fonts %{buildroot}%{_datadir}/web-assets/fonts + +install -Dpm0644 %{SOURCE2} %{buildroot}%{_rpmconfigdir}/macros.d/macros.web-assets + +%if 0%{?enable_httpd} +install -Dpm0644 %{SOURCE3} %{buildroot}%{_sysconfdir}/httpd/conf.d/web-assets.conf + +%post httpd +systemctl reload-or-try-restart httpd.service || : + +%postun httpd +systemctl reload-or-try-restart httpd.service || : +%endif + +%files filesystem +%{_datadir}/web-assets +%{_datadir}/javascript + +%files devel +%{_rpmconfigdir}/macros.d/macros.web-assets +%doc LICENSE README.devel + +%if 0%{?enable_httpd} +%files httpd +%config(noreplace) %{_sysconfdir}/httpd/conf.d/web-assets.conf +%doc LICENSE +%endif + +%changelog +* Sat Aug 24 2013 T.C. Hollingsworth - 4-2 +- tighten dependency on filesystem from other packages +- add brief README to -devel + +* Fri Aug 16 2013 T.C. Hollingsworth - 4-1 +- temporarily disable httpd stuff while we're waiting on sorting out the + directory + +* Tue Jul 30 2013 T.C. Hollingsworth - 3-1 +- rename directories per discussion on lists +- provide a /_sysassets/js shortcut + +* Fri Jul 19 2013 T.C. Hollingsworth - 2-1 +- rename the license now that we have proper git +- prefix httpd-exported directory with an underscore (thanks to Joe Orton) +- add "Require all granted" (thanks to Remi Collet) +- alias /usr/share/javascript explictly + +* Thu Jul 11 2013 T.C. Hollingsworth - 1-1 +- initial package