%global _empty_manifest_terminate_build 0 Name: python-django-components Version: 0.28.1 Release: 1 Summary: A way to create simple reusable template components in Django. License: MIT URL: https://github.com/EmilStenstrom/django-components/ Source0: https://mirrors.aliyun.com/pypi/web/packages/ea/87/8905ca036543921bbbff6e6a24f6ebab88e4ca87e9b3b3e28d84f2faf7e5/django_components-0.28.1.tar.gz BuildArch: noarch Requires: python3-Django %description Components support something called 'slots'. When a component is used inside another template, slots allow the parent template to override specific parts of the child component by passing in different content. This mechanism makes components more reusable and composable. In the example below we introduce two block tags that work hand in hand to make this work. These are... - `{% slot %}`/`{% endslot %}`: Declares a new slot in the component template. - `{% fill %}`/`{% endfill %}`: (Used inside a `component_block` tag pair.) Fills a declared slot with the specified content. Let's update our calendar component to support more customization. We'll add `slot` tag pairs to its template, _calendar.html_. ```htmldjango
{% slot "header" %}Calendar header{% endslot %}
{% slot "body" %}Today's date is {{ date }}{% endslot %}
``` When using the component, you specify which slots you want to fill and where you want to use the defaults from the template. It looks like this: ```htmldjango {% component_block "calendar" date="2020-06-06" %} {% fill "body" %}Can you believe it's already {{ date }}??{% endfill %} {% endcomponent_block %} ``` Since the header block is unspecified, it's taken from the base template. If you put this in a template, and pass in `date=2020-06-06`, this is what gets rendered: ```htmldjango
Calendar header
Can you believe it's already 2020-06-06??
``` As you can see, component slots lets you write reusable containers that you fill in when you use a component. This makes for highly reusable components that can be used in different circumstances. It can become tedious to use `fill` tags everywhere, especially when you're using a component that declares only one slot. To make things easier, `slot` tags can be marked with an optional keyword: `default`. When added to the end of the tag (as shown below), this option lets you pass filling content directly in the body of a `component_block` tag pair – without using a `fill` tag. Choose carefully, though: a component template may contain at most one slot that is marked as `default`. The `default` option can be combined with other slot options, e.g. `required`. Here's the same example as before, except with default slots and implicit filling. The template: ```htmldjango
{% slot "header" %}Calendar header{% endslot %}
{% slot "body" default %}Today's date is {{ date }}{% endslot %}
``` Including the component (notice how the `fill` tag is omitted): ```htmldjango {% component_block "calendar" date="2020-06-06" %} Can you believe it's already {{ date }}?? {% endcomponent_block %} ``` The rendered result (exactly the same as before): ```html
Calendar header
Can you believe it's already 2020-06-06??
``` You may be tempted to combine implicit fills with explicit `fill` tags. This will not work. The following component template will raise an error when compiled. ```htmldjango {# DON'T DO THIS #} {% component_block "calendar" date="2020-06-06" %} {% fill "header" %}Totally new header!{% endfill %} Can you believe it's already {{ date }}?? {% endcomponent_block %} ``` By contrast, it is permitted to use `fill` tags in nested components, e.g.: ```htmldjango {% component_block "calendar" date="2020-06-06" %} {% component_block "beautiful-box" %} {% fill "content" %} Can you believe it's already {{ date }}?? {% endfill %} {% endcomponent_block {% endcomponent_block %} ``` This is fine too: ```htmldjango {% component_block "calendar" date="2020-06-06" %} {% fill "header" %} {% component_block "calendar-header" %} Super Special Calendar Header {% endcomponent_block {% endfill %} {% endcomponent_block %} ``` ### Advanced #### Re-using content defined in the original slot Certain properties of a slot can be accessed from within a 'fill' context. They are provided as attributes on a user-defined alias of the targeted slot. For instance, let's say you're filling a slot called 'body'. To access properties of this slot, alias it using the 'as' keyword to a new name -- or keep the original name. With the new slot alias, you can call `.default` to insert the default content. ```htmldjango {% component_block "calendar" date="2020-06-06" %} {% fill "body" as "body" %}{{ body.default }}. Have a great day!{% endslot %} {% endcomponent_block %} ``` Produces: ```htmldjango
Calendar header
Today's date is 2020-06-06. Have a great day!
``` #### Conditional slots _Added in version 0.26._ In certain circumstances, you may want the behavior of slot filling to depend on whether or not a particular slot is filled. For example, suppose we have the following component template: ```htmldjango
{% slot "title" %}Title{% endslot %}
{% slot "subtitle" %}{# Optional subtitle #}{% endslot %}
``` By default the slot named 'subtitle' is empty. Yet when the component is used without explicit fills, the div containing the slot is still rendered, as shown below: ```html
Title
``` This may not be what you want. What if instead the outer 'subtitle' div should only be included when the inner slot is in fact filled? The answer is to use the `{% if_filled %}` tag. Together with `{% endif_filled %}`, these define a block whose contents will be rendered only if the component slot with the corresponding 'name' is filled. This is what our example looks like with an 'if_filled' tag. ```htmldjango
{% slot "title" %}Title{% endslot %}
{% if_filled "subtitle" %}
{% slot "subtitle" %}{# Optional subtitle #}{% endslot %}
{% endif_filled %}
``` Just as Django's builtin 'if' tag has 'elif' and 'else' counterparts, so does 'if_filled' include additional tags for more complex branching. These tags are 'elif_filled' and 'else_filled'. Here's what our example looks like with them. ```htmldjango
{% slot "title" %}Title{% endslot %}
{% if_filled "subtitle" %}
{% slot "subtitle" %}{# Optional subtitle #}{% endslot %}
{% elif_filled "title" %} {% else_filled %} {% endif_filled %}
``` Sometimes you're not interested in whether a slot is filled, but rather that it _isn't_. To negate the meaning of 'if_filled' in this way, an optional boolean can be passed to the 'if_filled' and 'elif_filled' tags. In the example below we use `False` to indicate that the content should be rendered only if the slot 'subtitle' is _not_ filled. ```htmldjango {% if_filled subtitle False %}
{% slot "subtitle" %}{% endslot %}
{% endif_filled %} ``` ## Component context and scope By default, components can access context variables from the parent template, just like templates that are included with the `{% include %}` tag. Just like with `{% include %}`, if you don't want the component template to have access to the parent context, add `only` to the end of the `{% component %}` (or `{% component_block %}` tag): ```htmldjango {% component "calendar" date="2015-06-19" only %} ``` NOTE: `{% csrf_token %}` tags need access to the top-level context, and they will not function properly if they are rendered in a component that is called with the `only` modifier. Components can also access the outer context in their context methods by accessing the property `outer_context`. ## Available settings All library settings are handled from a global COMPONENTS variable that is read from settings.py. By default you don't need it set, there are resonable defaults. ### Configure the module where components are loaded from Configure the location where components are loaded. To do this, add a COMPONENTS variable to you settings.py with a list of python paths to load. This allows you to build a structure of components that are independent from your apps. ```python COMPONENTS = { "libraries": [ "mysite.components.forms", "mysite.components.buttons", "mysite.components.cards", ], } ``` ### Disable autodiscovery If you specify all the component locations with the setting above and have a lot of apps, you can (very) slightly speed things up by disabling autodiscovery. ```python COMPONENTS = { "autodiscover": False, } ``` ### Tune the template cache Each time a template is rendered it is cached to a global in-memory cache (using Python's lru_cache decorator). This speeds up the next render of the component. As the same component is often used many times on the same page, these savings add up. By default the cache holds 128 component templates in memory, which should be enough for most sites. But if you have a lot of components, or if you are using the `template` method of a component to render lots of dynamic templates, you can increase this number. To remove the cache limit altogether and cache everything, set template_cache_size to `None`. ```python COMPONENTS = { "template_cache_size": 256, } ``` ## Install locally and run the tests Start by forking the project by clicking the **Fork button** up in the right corner in the GitHub . This makes a copy of the repository in your own name. Now you can clone this repository locally and start adding features: ```sh git clone https://github.com//django-components.git ``` To quickly run the tests install the local dependencies by running: ```sh pip install -r requirements-dev.txt ``` Now you can run the tests to make sure everything works as expected: ```sh pytest ``` The library is also tested across many versions of Python and Django. To run tests that way: ```sh pyenv install 3.6.9 pyenv install 3.7.9 pyenv install 3.8.9 pyenv install 3.9.4 pyenv install 3.10.5 pyenv local 3.6.9 3.7.9 3.8.9 3.9.4 3.10.5 tox -p ``` %package -n python3-django-components Summary: A way to create simple reusable template components in Django. Provides: python-django-components BuildRequires: python3-devel BuildRequires: python3-setuptools BuildRequires: python3-pip %description -n python3-django-components Components support something called 'slots'. When a component is used inside another template, slots allow the parent template to override specific parts of the child component by passing in different content. This mechanism makes components more reusable and composable. In the example below we introduce two block tags that work hand in hand to make this work. These are... - `{% slot %}`/`{% endslot %}`: Declares a new slot in the component template. - `{% fill %}`/`{% endfill %}`: (Used inside a `component_block` tag pair.) Fills a declared slot with the specified content. Let's update our calendar component to support more customization. We'll add `slot` tag pairs to its template, _calendar.html_. ```htmldjango
{% slot "header" %}Calendar header{% endslot %}
{% slot "body" %}Today's date is {{ date }}{% endslot %}
``` When using the component, you specify which slots you want to fill and where you want to use the defaults from the template. It looks like this: ```htmldjango {% component_block "calendar" date="2020-06-06" %} {% fill "body" %}Can you believe it's already {{ date }}??{% endfill %} {% endcomponent_block %} ``` Since the header block is unspecified, it's taken from the base template. If you put this in a template, and pass in `date=2020-06-06`, this is what gets rendered: ```htmldjango
Calendar header
Can you believe it's already 2020-06-06??
``` As you can see, component slots lets you write reusable containers that you fill in when you use a component. This makes for highly reusable components that can be used in different circumstances. It can become tedious to use `fill` tags everywhere, especially when you're using a component that declares only one slot. To make things easier, `slot` tags can be marked with an optional keyword: `default`. When added to the end of the tag (as shown below), this option lets you pass filling content directly in the body of a `component_block` tag pair – without using a `fill` tag. Choose carefully, though: a component template may contain at most one slot that is marked as `default`. The `default` option can be combined with other slot options, e.g. `required`. Here's the same example as before, except with default slots and implicit filling. The template: ```htmldjango
{% slot "header" %}Calendar header{% endslot %}
{% slot "body" default %}Today's date is {{ date }}{% endslot %}
``` Including the component (notice how the `fill` tag is omitted): ```htmldjango {% component_block "calendar" date="2020-06-06" %} Can you believe it's already {{ date }}?? {% endcomponent_block %} ``` The rendered result (exactly the same as before): ```html
Calendar header
Can you believe it's already 2020-06-06??
``` You may be tempted to combine implicit fills with explicit `fill` tags. This will not work. The following component template will raise an error when compiled. ```htmldjango {# DON'T DO THIS #} {% component_block "calendar" date="2020-06-06" %} {% fill "header" %}Totally new header!{% endfill %} Can you believe it's already {{ date }}?? {% endcomponent_block %} ``` By contrast, it is permitted to use `fill` tags in nested components, e.g.: ```htmldjango {% component_block "calendar" date="2020-06-06" %} {% component_block "beautiful-box" %} {% fill "content" %} Can you believe it's already {{ date }}?? {% endfill %} {% endcomponent_block {% endcomponent_block %} ``` This is fine too: ```htmldjango {% component_block "calendar" date="2020-06-06" %} {% fill "header" %} {% component_block "calendar-header" %} Super Special Calendar Header {% endcomponent_block {% endfill %} {% endcomponent_block %} ``` ### Advanced #### Re-using content defined in the original slot Certain properties of a slot can be accessed from within a 'fill' context. They are provided as attributes on a user-defined alias of the targeted slot. For instance, let's say you're filling a slot called 'body'. To access properties of this slot, alias it using the 'as' keyword to a new name -- or keep the original name. With the new slot alias, you can call `.default` to insert the default content. ```htmldjango {% component_block "calendar" date="2020-06-06" %} {% fill "body" as "body" %}{{ body.default }}. Have a great day!{% endslot %} {% endcomponent_block %} ``` Produces: ```htmldjango
Calendar header
Today's date is 2020-06-06. Have a great day!
``` #### Conditional slots _Added in version 0.26._ In certain circumstances, you may want the behavior of slot filling to depend on whether or not a particular slot is filled. For example, suppose we have the following component template: ```htmldjango
{% slot "title" %}Title{% endslot %}
{% slot "subtitle" %}{# Optional subtitle #}{% endslot %}
``` By default the slot named 'subtitle' is empty. Yet when the component is used without explicit fills, the div containing the slot is still rendered, as shown below: ```html
Title
``` This may not be what you want. What if instead the outer 'subtitle' div should only be included when the inner slot is in fact filled? The answer is to use the `{% if_filled %}` tag. Together with `{% endif_filled %}`, these define a block whose contents will be rendered only if the component slot with the corresponding 'name' is filled. This is what our example looks like with an 'if_filled' tag. ```htmldjango
{% slot "title" %}Title{% endslot %}
{% if_filled "subtitle" %}
{% slot "subtitle" %}{# Optional subtitle #}{% endslot %}
{% endif_filled %}
``` Just as Django's builtin 'if' tag has 'elif' and 'else' counterparts, so does 'if_filled' include additional tags for more complex branching. These tags are 'elif_filled' and 'else_filled'. Here's what our example looks like with them. ```htmldjango
{% slot "title" %}Title{% endslot %}
{% if_filled "subtitle" %}
{% slot "subtitle" %}{# Optional subtitle #}{% endslot %}
{% elif_filled "title" %} {% else_filled %} {% endif_filled %}
``` Sometimes you're not interested in whether a slot is filled, but rather that it _isn't_. To negate the meaning of 'if_filled' in this way, an optional boolean can be passed to the 'if_filled' and 'elif_filled' tags. In the example below we use `False` to indicate that the content should be rendered only if the slot 'subtitle' is _not_ filled. ```htmldjango {% if_filled subtitle False %}
{% slot "subtitle" %}{% endslot %}
{% endif_filled %} ``` ## Component context and scope By default, components can access context variables from the parent template, just like templates that are included with the `{% include %}` tag. Just like with `{% include %}`, if you don't want the component template to have access to the parent context, add `only` to the end of the `{% component %}` (or `{% component_block %}` tag): ```htmldjango {% component "calendar" date="2015-06-19" only %} ``` NOTE: `{% csrf_token %}` tags need access to the top-level context, and they will not function properly if they are rendered in a component that is called with the `only` modifier. Components can also access the outer context in their context methods by accessing the property `outer_context`. ## Available settings All library settings are handled from a global COMPONENTS variable that is read from settings.py. By default you don't need it set, there are resonable defaults. ### Configure the module where components are loaded from Configure the location where components are loaded. To do this, add a COMPONENTS variable to you settings.py with a list of python paths to load. This allows you to build a structure of components that are independent from your apps. ```python COMPONENTS = { "libraries": [ "mysite.components.forms", "mysite.components.buttons", "mysite.components.cards", ], } ``` ### Disable autodiscovery If you specify all the component locations with the setting above and have a lot of apps, you can (very) slightly speed things up by disabling autodiscovery. ```python COMPONENTS = { "autodiscover": False, } ``` ### Tune the template cache Each time a template is rendered it is cached to a global in-memory cache (using Python's lru_cache decorator). This speeds up the next render of the component. As the same component is often used many times on the same page, these savings add up. By default the cache holds 128 component templates in memory, which should be enough for most sites. But if you have a lot of components, or if you are using the `template` method of a component to render lots of dynamic templates, you can increase this number. To remove the cache limit altogether and cache everything, set template_cache_size to `None`. ```python COMPONENTS = { "template_cache_size": 256, } ``` ## Install locally and run the tests Start by forking the project by clicking the **Fork button** up in the right corner in the GitHub . This makes a copy of the repository in your own name. Now you can clone this repository locally and start adding features: ```sh git clone https://github.com//django-components.git ``` To quickly run the tests install the local dependencies by running: ```sh pip install -r requirements-dev.txt ``` Now you can run the tests to make sure everything works as expected: ```sh pytest ``` The library is also tested across many versions of Python and Django. To run tests that way: ```sh pyenv install 3.6.9 pyenv install 3.7.9 pyenv install 3.8.9 pyenv install 3.9.4 pyenv install 3.10.5 pyenv local 3.6.9 3.7.9 3.8.9 3.9.4 3.10.5 tox -p ``` %package help Summary: Development documents and examples for django-components Provides: python3-django-components-doc %description help Components support something called 'slots'. When a component is used inside another template, slots allow the parent template to override specific parts of the child component by passing in different content. This mechanism makes components more reusable and composable. In the example below we introduce two block tags that work hand in hand to make this work. These are... - `{% slot %}`/`{% endslot %}`: Declares a new slot in the component template. - `{% fill %}`/`{% endfill %}`: (Used inside a `component_block` tag pair.) Fills a declared slot with the specified content. Let's update our calendar component to support more customization. We'll add `slot` tag pairs to its template, _calendar.html_. ```htmldjango
{% slot "header" %}Calendar header{% endslot %}
{% slot "body" %}Today's date is {{ date }}{% endslot %}
``` When using the component, you specify which slots you want to fill and where you want to use the defaults from the template. It looks like this: ```htmldjango {% component_block "calendar" date="2020-06-06" %} {% fill "body" %}Can you believe it's already {{ date }}??{% endfill %} {% endcomponent_block %} ``` Since the header block is unspecified, it's taken from the base template. If you put this in a template, and pass in `date=2020-06-06`, this is what gets rendered: ```htmldjango
Calendar header
Can you believe it's already 2020-06-06??
``` As you can see, component slots lets you write reusable containers that you fill in when you use a component. This makes for highly reusable components that can be used in different circumstances. It can become tedious to use `fill` tags everywhere, especially when you're using a component that declares only one slot. To make things easier, `slot` tags can be marked with an optional keyword: `default`. When added to the end of the tag (as shown below), this option lets you pass filling content directly in the body of a `component_block` tag pair – without using a `fill` tag. Choose carefully, though: a component template may contain at most one slot that is marked as `default`. The `default` option can be combined with other slot options, e.g. `required`. Here's the same example as before, except with default slots and implicit filling. The template: ```htmldjango
{% slot "header" %}Calendar header{% endslot %}
{% slot "body" default %}Today's date is {{ date }}{% endslot %}
``` Including the component (notice how the `fill` tag is omitted): ```htmldjango {% component_block "calendar" date="2020-06-06" %} Can you believe it's already {{ date }}?? {% endcomponent_block %} ``` The rendered result (exactly the same as before): ```html
Calendar header
Can you believe it's already 2020-06-06??
``` You may be tempted to combine implicit fills with explicit `fill` tags. This will not work. The following component template will raise an error when compiled. ```htmldjango {# DON'T DO THIS #} {% component_block "calendar" date="2020-06-06" %} {% fill "header" %}Totally new header!{% endfill %} Can you believe it's already {{ date }}?? {% endcomponent_block %} ``` By contrast, it is permitted to use `fill` tags in nested components, e.g.: ```htmldjango {% component_block "calendar" date="2020-06-06" %} {% component_block "beautiful-box" %} {% fill "content" %} Can you believe it's already {{ date }}?? {% endfill %} {% endcomponent_block {% endcomponent_block %} ``` This is fine too: ```htmldjango {% component_block "calendar" date="2020-06-06" %} {% fill "header" %} {% component_block "calendar-header" %} Super Special Calendar Header {% endcomponent_block {% endfill %} {% endcomponent_block %} ``` ### Advanced #### Re-using content defined in the original slot Certain properties of a slot can be accessed from within a 'fill' context. They are provided as attributes on a user-defined alias of the targeted slot. For instance, let's say you're filling a slot called 'body'. To access properties of this slot, alias it using the 'as' keyword to a new name -- or keep the original name. With the new slot alias, you can call `.default` to insert the default content. ```htmldjango {% component_block "calendar" date="2020-06-06" %} {% fill "body" as "body" %}{{ body.default }}. Have a great day!{% endslot %} {% endcomponent_block %} ``` Produces: ```htmldjango
Calendar header
Today's date is 2020-06-06. Have a great day!
``` #### Conditional slots _Added in version 0.26._ In certain circumstances, you may want the behavior of slot filling to depend on whether or not a particular slot is filled. For example, suppose we have the following component template: ```htmldjango
{% slot "title" %}Title{% endslot %}
{% slot "subtitle" %}{# Optional subtitle #}{% endslot %}
``` By default the slot named 'subtitle' is empty. Yet when the component is used without explicit fills, the div containing the slot is still rendered, as shown below: ```html
Title
``` This may not be what you want. What if instead the outer 'subtitle' div should only be included when the inner slot is in fact filled? The answer is to use the `{% if_filled %}` tag. Together with `{% endif_filled %}`, these define a block whose contents will be rendered only if the component slot with the corresponding 'name' is filled. This is what our example looks like with an 'if_filled' tag. ```htmldjango
{% slot "title" %}Title{% endslot %}
{% if_filled "subtitle" %}
{% slot "subtitle" %}{# Optional subtitle #}{% endslot %}
{% endif_filled %}
``` Just as Django's builtin 'if' tag has 'elif' and 'else' counterparts, so does 'if_filled' include additional tags for more complex branching. These tags are 'elif_filled' and 'else_filled'. Here's what our example looks like with them. ```htmldjango
{% slot "title" %}Title{% endslot %}
{% if_filled "subtitle" %}
{% slot "subtitle" %}{# Optional subtitle #}{% endslot %}
{% elif_filled "title" %} {% else_filled %} {% endif_filled %}
``` Sometimes you're not interested in whether a slot is filled, but rather that it _isn't_. To negate the meaning of 'if_filled' in this way, an optional boolean can be passed to the 'if_filled' and 'elif_filled' tags. In the example below we use `False` to indicate that the content should be rendered only if the slot 'subtitle' is _not_ filled. ```htmldjango {% if_filled subtitle False %}
{% slot "subtitle" %}{% endslot %}
{% endif_filled %} ``` ## Component context and scope By default, components can access context variables from the parent template, just like templates that are included with the `{% include %}` tag. Just like with `{% include %}`, if you don't want the component template to have access to the parent context, add `only` to the end of the `{% component %}` (or `{% component_block %}` tag): ```htmldjango {% component "calendar" date="2015-06-19" only %} ``` NOTE: `{% csrf_token %}` tags need access to the top-level context, and they will not function properly if they are rendered in a component that is called with the `only` modifier. Components can also access the outer context in their context methods by accessing the property `outer_context`. ## Available settings All library settings are handled from a global COMPONENTS variable that is read from settings.py. By default you don't need it set, there are resonable defaults. ### Configure the module where components are loaded from Configure the location where components are loaded. To do this, add a COMPONENTS variable to you settings.py with a list of python paths to load. This allows you to build a structure of components that are independent from your apps. ```python COMPONENTS = { "libraries": [ "mysite.components.forms", "mysite.components.buttons", "mysite.components.cards", ], } ``` ### Disable autodiscovery If you specify all the component locations with the setting above and have a lot of apps, you can (very) slightly speed things up by disabling autodiscovery. ```python COMPONENTS = { "autodiscover": False, } ``` ### Tune the template cache Each time a template is rendered it is cached to a global in-memory cache (using Python's lru_cache decorator). This speeds up the next render of the component. As the same component is often used many times on the same page, these savings add up. By default the cache holds 128 component templates in memory, which should be enough for most sites. But if you have a lot of components, or if you are using the `template` method of a component to render lots of dynamic templates, you can increase this number. To remove the cache limit altogether and cache everything, set template_cache_size to `None`. ```python COMPONENTS = { "template_cache_size": 256, } ``` ## Install locally and run the tests Start by forking the project by clicking the **Fork button** up in the right corner in the GitHub . This makes a copy of the repository in your own name. Now you can clone this repository locally and start adding features: ```sh git clone https://github.com//django-components.git ``` To quickly run the tests install the local dependencies by running: ```sh pip install -r requirements-dev.txt ``` Now you can run the tests to make sure everything works as expected: ```sh pytest ``` The library is also tested across many versions of Python and Django. To run tests that way: ```sh pyenv install 3.6.9 pyenv install 3.7.9 pyenv install 3.8.9 pyenv install 3.9.4 pyenv install 3.10.5 pyenv local 3.6.9 3.7.9 3.8.9 3.9.4 3.10.5 tox -p ``` %prep %autosetup -n django_components-0.28.1 %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-components -f filelist.lst %dir %{python3_sitelib}/* %files help -f doclist.lst %{_docdir}/* %changelog * Thu Jun 08 2023 Python_Bot - 0.28.1-1 - Package Spec generated