From 1a0ea17f8aa43c2f50a786a1c5125ded4624fce7 Mon Sep 17 00:00:00 2001 From: CoprDistGit Date: Fri, 5 May 2023 13:49:28 +0000 Subject: automatic import of python-django-compress-staticfiles --- .gitignore | 1 + python-django-compress-staticfiles.spec | 214 ++++++++++++++++++++++++++++++++ sources | 1 + 3 files changed, 216 insertions(+) create mode 100644 python-django-compress-staticfiles.spec create mode 100644 sources diff --git a/.gitignore b/.gitignore index e69de29..e6d95c9 100644 --- a/.gitignore +++ b/.gitignore @@ -0,0 +1 @@ +/django-compress-staticfiles-1.0.1b0.tar.gz diff --git a/python-django-compress-staticfiles.spec b/python-django-compress-staticfiles.spec new file mode 100644 index 0000000..93a2efb --- /dev/null +++ b/python-django-compress-staticfiles.spec @@ -0,0 +1,214 @@ +%global _empty_manifest_terminate_build 0 +Name: python-django-compress-staticfiles +Version: 1.0.1b0 +Release: 1 +Summary: A static files storage backend for compression using GZip and/or Brotli that inherits from Djangos ManifestFilesMixin and StaticFilesStorage; also minifies static files. +License: GPL-3.0 +URL: https://github.com/armandtvz/django-compress-staticfiles +Source0: https://mirrors.nju.edu.cn/pypi/web/packages/64/cc/24ab289c1c2563033f7096fae679364b8afbceb10d53d2d070d3c7083076/django-compress-staticfiles-1.0.1b0.tar.gz +BuildArch: noarch + +Requires: python3-Django +Requires: python3-Brotli +Requires: python3-csscompressor +Requires: python3-rjsmin + +%description +A Django static files storage backend inheriting from [ManifestFilesMixin][16] +and [StaticFilesStorage][12]. Compresses, using GZip and/or Brotli, and minifies +static files when running the Django [collectstatic][5] command. +### What this package does: +- Compresses static files using [Brotli][1] and/or GZip. See the [included + filetypes][100] heading to see which filetypes are compressed. +- Minifies JS using [rJSMin][19]. +- Minifies CSS using [csscompressor][6]. +### What this package does *not* do: +- Does not support concatenation/bundling of JS or CSS. +- Does not support transpiling from any transpiling Javascript language. +- Does not support [SASS][13], [LESS][14] or any other CSS preprocessor. +- This package is not a linter or tester. The collectstatic command is not the + place to be linting or testing your code. The primary purpose of this package + is compressing staticfiles for use in staging or production environments — + minification is optional but does so by default. +- Does not delete stale files from your `STATIC_ROOT` directory. If changes were + made to some of your static files; old files will remain there. Use the + `--clear` flag when running `collectstatic` to delete the entire `STATIC_ROOT` + and recreate it — check out the Django docs for more info. +### Some important things to take note of: +- If `DEBUG = True` in your Django settings.py file; only the normal file + is used in templates. Templates will only use the hashed and minified + version of the file when `DEBUG = False`. This is the behaviour of the Django + [staticfiles][15] app in the `url` method of the `ManifestFilesMixin`. +- The compressed version of the file is never used in the template. Your + webserver can decide which version of the file to serve depending on the + Accept-Encoding header in the request. +- This package updates the manifest JSON file created by ManifestFilesMixin + with a path pointing to the hashed *and* minified version of each processed + file where applicable. +- If there is a `.min` file to be copied to STATIC_ROOT; that file will be + compressed but not re-minified. If that `.min` file has a corresponding + non-minified counterpart, that non-minified file *will* be minified and + that minified file is the one that will be used to map `regular.css` to + `regular.min.{hash}.css` in the manifest file. +- This package does not yet deal with the @import rule and url() function in + CSS; therefore the value is not updated after ManifestFilesMixin handles those + things — the minified file will not be referenced, only the hashed version as + substituted by ManifestFilesMixin. +- The original files, for example, `somefile.css` won't be compressed + to `somefile.css.gz` because we will likely never use it. +- Files smaller than 200 bytes will not be compressed. +### Usage with cloud storage like Google Cloud Storage or Amazon S3: +Even though the CompressStaticFilesStorage inherits from StaticFilesStorage, +which inherits from FileSystemStorage, the CompressStaticFilesMixin and +MinifyFilesMixin can be used with your own storage. + +%package -n python3-django-compress-staticfiles +Summary: A static files storage backend for compression using GZip and/or Brotli that inherits from Djangos ManifestFilesMixin and StaticFilesStorage; also minifies static files. +Provides: python-django-compress-staticfiles +BuildRequires: python3-devel +BuildRequires: python3-setuptools +BuildRequires: python3-pip +%description -n python3-django-compress-staticfiles +A Django static files storage backend inheriting from [ManifestFilesMixin][16] +and [StaticFilesStorage][12]. Compresses, using GZip and/or Brotli, and minifies +static files when running the Django [collectstatic][5] command. +### What this package does: +- Compresses static files using [Brotli][1] and/or GZip. See the [included + filetypes][100] heading to see which filetypes are compressed. +- Minifies JS using [rJSMin][19]. +- Minifies CSS using [csscompressor][6]. +### What this package does *not* do: +- Does not support concatenation/bundling of JS or CSS. +- Does not support transpiling from any transpiling Javascript language. +- Does not support [SASS][13], [LESS][14] or any other CSS preprocessor. +- This package is not a linter or tester. The collectstatic command is not the + place to be linting or testing your code. The primary purpose of this package + is compressing staticfiles for use in staging or production environments — + minification is optional but does so by default. +- Does not delete stale files from your `STATIC_ROOT` directory. If changes were + made to some of your static files; old files will remain there. Use the + `--clear` flag when running `collectstatic` to delete the entire `STATIC_ROOT` + and recreate it — check out the Django docs for more info. +### Some important things to take note of: +- If `DEBUG = True` in your Django settings.py file; only the normal file + is used in templates. Templates will only use the hashed and minified + version of the file when `DEBUG = False`. This is the behaviour of the Django + [staticfiles][15] app in the `url` method of the `ManifestFilesMixin`. +- The compressed version of the file is never used in the template. Your + webserver can decide which version of the file to serve depending on the + Accept-Encoding header in the request. +- This package updates the manifest JSON file created by ManifestFilesMixin + with a path pointing to the hashed *and* minified version of each processed + file where applicable. +- If there is a `.min` file to be copied to STATIC_ROOT; that file will be + compressed but not re-minified. If that `.min` file has a corresponding + non-minified counterpart, that non-minified file *will* be minified and + that minified file is the one that will be used to map `regular.css` to + `regular.min.{hash}.css` in the manifest file. +- This package does not yet deal with the @import rule and url() function in + CSS; therefore the value is not updated after ManifestFilesMixin handles those + things — the minified file will not be referenced, only the hashed version as + substituted by ManifestFilesMixin. +- The original files, for example, `somefile.css` won't be compressed + to `somefile.css.gz` because we will likely never use it. +- Files smaller than 200 bytes will not be compressed. +### Usage with cloud storage like Google Cloud Storage or Amazon S3: +Even though the CompressStaticFilesStorage inherits from StaticFilesStorage, +which inherits from FileSystemStorage, the CompressStaticFilesMixin and +MinifyFilesMixin can be used with your own storage. + +%package help +Summary: Development documents and examples for django-compress-staticfiles +Provides: python3-django-compress-staticfiles-doc +%description help +A Django static files storage backend inheriting from [ManifestFilesMixin][16] +and [StaticFilesStorage][12]. Compresses, using GZip and/or Brotli, and minifies +static files when running the Django [collectstatic][5] command. +### What this package does: +- Compresses static files using [Brotli][1] and/or GZip. See the [included + filetypes][100] heading to see which filetypes are compressed. +- Minifies JS using [rJSMin][19]. +- Minifies CSS using [csscompressor][6]. +### What this package does *not* do: +- Does not support concatenation/bundling of JS or CSS. +- Does not support transpiling from any transpiling Javascript language. +- Does not support [SASS][13], [LESS][14] or any other CSS preprocessor. +- This package is not a linter or tester. The collectstatic command is not the + place to be linting or testing your code. The primary purpose of this package + is compressing staticfiles for use in staging or production environments — + minification is optional but does so by default. +- Does not delete stale files from your `STATIC_ROOT` directory. If changes were + made to some of your static files; old files will remain there. Use the + `--clear` flag when running `collectstatic` to delete the entire `STATIC_ROOT` + and recreate it — check out the Django docs for more info. +### Some important things to take note of: +- If `DEBUG = True` in your Django settings.py file; only the normal file + is used in templates. Templates will only use the hashed and minified + version of the file when `DEBUG = False`. This is the behaviour of the Django + [staticfiles][15] app in the `url` method of the `ManifestFilesMixin`. +- The compressed version of the file is never used in the template. Your + webserver can decide which version of the file to serve depending on the + Accept-Encoding header in the request. +- This package updates the manifest JSON file created by ManifestFilesMixin + with a path pointing to the hashed *and* minified version of each processed + file where applicable. +- If there is a `.min` file to be copied to STATIC_ROOT; that file will be + compressed but not re-minified. If that `.min` file has a corresponding + non-minified counterpart, that non-minified file *will* be minified and + that minified file is the one that will be used to map `regular.css` to + `regular.min.{hash}.css` in the manifest file. +- This package does not yet deal with the @import rule and url() function in + CSS; therefore the value is not updated after ManifestFilesMixin handles those + things — the minified file will not be referenced, only the hashed version as + substituted by ManifestFilesMixin. +- The original files, for example, `somefile.css` won't be compressed + to `somefile.css.gz` because we will likely never use it. +- Files smaller than 200 bytes will not be compressed. +### Usage with cloud storage like Google Cloud Storage or Amazon S3: +Even though the CompressStaticFilesStorage inherits from StaticFilesStorage, +which inherits from FileSystemStorage, the CompressStaticFilesMixin and +MinifyFilesMixin can be used with your own storage. + +%prep +%autosetup -n django-compress-staticfiles-1.0.1b0 + +%build +%py3_build + +%install +%py3_install +install -d -m755 %{buildroot}/%{_pkgdocdir} +if [ -d doc ]; then cp -arf doc %{buildroot}/%{_pkgdocdir}; fi +if [ -d docs ]; then cp -arf docs %{buildroot}/%{_pkgdocdir}; fi +if [ -d example ]; then cp -arf example %{buildroot}/%{_pkgdocdir}; fi +if [ -d examples ]; then cp -arf examples %{buildroot}/%{_pkgdocdir}; fi +pushd %{buildroot} +if [ -d usr/lib ]; then + find usr/lib -type f -printf "/%h/%f\n" >> filelist.lst +fi +if [ -d usr/lib64 ]; then + find usr/lib64 -type f -printf "/%h/%f\n" >> filelist.lst +fi +if [ -d usr/bin ]; then + find usr/bin -type f -printf "/%h/%f\n" >> filelist.lst +fi +if [ -d usr/sbin ]; then + find usr/sbin -type f -printf "/%h/%f\n" >> filelist.lst +fi +touch doclist.lst +if [ -d usr/share/man ]; then + find usr/share/man -type f -printf "/%h/%f.gz\n" >> doclist.lst +fi +popd +mv %{buildroot}/filelist.lst . +mv %{buildroot}/doclist.lst . + +%files -n python3-django-compress-staticfiles -f filelist.lst +%dir %{python3_sitelib}/* + +%files help -f doclist.lst +%{_docdir}/* + +%changelog +* Fri May 05 2023 Python_Bot - 1.0.1b0-1 +- Package Spec generated diff --git a/sources b/sources new file mode 100644 index 0000000..ee1d7af --- /dev/null +++ b/sources @@ -0,0 +1 @@ +dabf8c573bdec0f4c06d290bf10f484b django-compress-staticfiles-1.0.1b0.tar.gz -- cgit v1.2.3